command line cmyk

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?".
Post Reply
anakein

command line cmyk

Post by anakein »

hi and sorry for my english.

I discover very simple steps into photoshop for signature photo, but i need to make script in imagemagick (i think imagemagick can it).

please see this photo: http://www.sonyalpha.es/pruebacmyk.jpg

in first look the photo don´t show anormal colour, but....
Open the photo in photoshop
convert in cmyk mode
in channel deactivate all channel and activate cyan channel only.
NOW you can to see my signature.

well, I want repeat into imagemagick steps for add my signature.
Steps.
convert image to cmyk, select cyan channel and copy new image with me signature into cyan channel with defined color.

can IM to make it?

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

Re: command line cmyk

Post by fmw42 »

yes, it should be possible. but your signature is more prevalent in the yellow than the cyan and can be seen in other channels.

post a link to your original image and to your signature image. IM does not have the ability to write cursive text to my knowledge as you have no interactive drawing ability in command line tools (possibly in the interactive display tool). But you can add text from font files. so you may need to create your signature image elsewhere.

I have tried this and unfortunately it does not work well as the conversion from cmyk to rgb causes the signature to leak into the rgb and when you convert the result back to cmyk, you see the signature in each channel. Using black text works a bit better, but you can still see the signature in the rgb image if you look closely.

Here is what I tried:

Image

convert mandril3.png -colorspace cmyk -separate \
\( -clone 0 -fill gray -font Helvetica -pointsize 18 -gravity center \
-annotate +0+0 "signature" \) -swap 0,4 -delete 4 \
-set colorspace cmyk -combine -colorspace rgb mandril3_sig_gray.png

Image

convert mandril3_sig_gray.png -colorspace cmyk -separate mandril3_sig_gray_cmyk_%d.png



convert mandril3.png -colorspace cmyk -separate \
\( -clone 0 -fill black -font Helvetica -pointsize 18 -gravity center \
-annotate +0+0 "signature" \) -swap 0,4 -delete 4 \
-set colorspace cmyk -combine -colorspace rgb mandril3_sig_black.png

Image

convert mandril3_sig_black.png -colorspace cmyk -separate mandril3_sig_black_cmyk_%d.png
anakein

Re: command line cmyk

Post by anakein »

original image is : http://sonyalpha.es/DSC01408.jpg.

for my image you need to use especific color for the signature C=36 M=20 Y=19 K=0 ( the color is calculate previously with other script, the full script will be displayed when is finish)

I Don't need convert again for cmyk, target image in rgb is good for me.

your command line dont work for me:
convert img.jpg -colorspace cmyk -separate \(-clone 0 -fill gray -font Helvetica -pointsize 18 -gravity center \-annotate +0+0 "sonyalpha"\) -swap 0,4 -delete 4 -set colorspace cmyk -combine -colorspace rgb img2.jpg
this is the result: sonyalpha.es/img2.jpg , only cyan color.

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

Re: command line cmyk

Post by fmw42 »

You cannot put a specific color in a single channel in IM, only grayscale values; otherwise, it converts the single channel into multiple channels.

Sorry don't know how to help you further.

If you are on windows, then my unix IM syntax won't work. See http://www.imagemagick.org/Usage/windows/
anakein

Re: command line cmyk

Post by anakein »

fmw42 wrote:You cannot put a specific color in a single channel in IM, only grayscale values; otherwise, it converts the single channel into multiple channels.

Sorry don't know how to help you further.

If you are on windows, then my unix IM syntax won't work. See http://www.imagemagick.org/Usage/windows/
windows no thanks, jeje use linux or mac i have not windows.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: command line cmyk

Post by fmw42 »

C=36 M=20 Y=19 K=0
You can put each C,M,Y,K grayscale value as text into each of the corresponding cmyk channels and then recombine, but you cannot put that specific color into only the cyan channel.
anakein

Re: command line cmyk

Post by anakein »

Mmy problem was IM version.
Now works.

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

Re: command line cmyk

Post by fmw42 »

If you can, please post your command line solution so others can try it.
Post Reply