Generating duotones

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
helcim

Re: Generating duotones

Post by helcim »

Ooops! I have just found this. Does that mean that use of imagemagick for that purpose is illegal?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Generating duotones

Post by anthony »

Okay. Your want to create a duotone that uses just two channels. The intensity channel, and a duotone color channel.

I believe if you tint your image using cyan, as you specified, then convert your image to
CMYK format before printing you should get what you want in the Cyan and blacK channels.

Hmmm, continuing with my recent additions to Tint duotone, and Sepia-Tone
http://www.imagemagick.org/Usage/color/#duotone
http://www.imagemagick.org/Usage/color/#sepia-tone
Lets try an experiment...
NB: the first line is just to make a greyscale image
The second is the tint with cyan
and the last extracts al four channel images..

Code: Select all

   convert rose: -colorspace gray -sigmoidal-contrast 10,40% \
                 -fill cyan  -tint 100 \
                 -colorspace CMYK -separate  duotone_channels.png
From the four channels Magenta and Yellow channels are completely black
The Black channel shows a lighter version of the grayscale image
While the Cyan show a very heavy cyan content.

Maybe I included too much cyan as it is a very light color. Changing tint to 50
and the Black channel becomes darker, though the cyan component did not seem to change

I'll take a look at the artical you pointed out.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Generating duotones

Post by anthony »

Hmmm further to my previous example.

When I used -fill darkcyan -tint 100 I had better contrast on the two channel images (still no magenta or yellow additions). that is the cyan channel was not almost completely white, and the black chnanel was closer to the original grayscale I generate from the rose image.

It may be that you just need to find the right 'color' for the tint to get what you need.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
helcim

Re: Generating duotones

Post by helcim »

Indeed, one could get a tinted image using the method you describe ready for printing but, I'm afraid you would not get the tonal range of a real duotone when printing such image.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Generating duotones

Post by anthony »

This may explain why the sepia tone uses some very complex functional mappings for each of the RGB channels. It isn't simply a grayscale to color tonal mapping. I never understood the weirdness of it until now.

Now if we can get the right functional mappings for cyanotype, then we can match what you are after, or the mappings that adobe's patent provides into photoshop.

As a minimum a Hald Color Lookup Table would probably work extremely well!
http://www.imagemagick.org/Usage/color/#hald

The problem is getting the right info.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
helcim

Re: Generating duotones

Post by helcim »

I wonder if it is possible to use spot colors in ImageMagick. It would really make sense in duotones. Of course the output should be a PDF or a Postscript file then.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Generating duotones

Post by anthony »

As I said, If we know the formula or methodology, we can certainly get something that works.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
helcim

Re: Generating duotones

Post by helcim »

I don't think one can and should give one universal formula which could be implemented. In my opinion it should be the responsibility of the user. The point is you may need different effects each time, so departing from two images prepared by a user by hand for each duotone channel does not seem a bad idea to me. The most simple script which produces yellow tinted duotones and takes as arguments the names of two prepared files for each channel and the name of an output file can be now

Code: Select all

#!/bin/sh
convert  $1 $2  -set colorspace CMYK -channel yellow,black -combine $3
So we definitely already can make duotones in CMYK colorspace. What is missing is DeviceN colorspace so that one could run the above script e.g. like this

Code: Select all

#!/bin/sh
convert  $1 $2  -set colorspace DeviceN -channel  -combine "PANTONE 308 CV","PANTONE 298 CV" $3
Obviously the output file could be only in one of the formats which support DeviceN colorspace, preferably pdf .
helcim

Re: Generating duotones

Post by helcim »

I don't know what happened with my post from before an hour, probably have not sent it at all. So here it is again. If we cannot generate DeviceN channels what about using their CMYK representation, after all that's what PDF has as alternate colorspace for spot colors. Is it possible to colorize two channels and obtain the output in CMYK? This would give some sort of preview (of course without taking dot gain and solidity into account).

Piotr
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Generating duotones

Post by fmw42 »

convert rgbimage -colorspace CMYK cmykimage

but the image type needs to support cmyk

also see
http://www.imagemagick.org/Usage/channels/#channels
blade196

Re: Generating duotones

Post by blade196 »

hi
i try to create a duotone with magick++ in C++ but i don't find how to apply 2 colors/ink to my picture.

i try tu use the same parameters of photoshop.

when i'v this grey picture

to converting to au duotone picture i use 2 color :

ink 1 : #989474 with a curve : 50 : 25%
ink 2 : #efede1 with a curve 0: 100%

i obtain this result but i don't know how obtain this result with magick++
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Generating duotones

Post by anthony »

After some thought I have added another duo-tone technique that should give you better control of the exact mid-tone color that use used. this involves using a color-lookup table generated from three exact colors for the black-point, mid-point and white-point of the duotone gradient.

See IM Examples, Color Modification, Duotone effects
http://www.imagemagick.org/Usage/color/#duotone
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Generating duotones

Post by fmw42 »

anthony wrote:After some thought I have added another duo-tone technique that should give you better control of the exact mid-tone color that use used. this involves using a color-lookup table generated from three exact colors for the black-point, mid-point and white-point of the duotone gradient.

See IM Examples, Color Modification, Duotone effects
http://www.imagemagick.org/Usage/color/#duotone

Similar to my tricolorize script at the link below.
Post Reply