(OSX or ubuntu, current IM.)
probably a common novice question, but a search here did not give me the answer.
I have a pdf file (in cmyk). I first convert it into a png file. this part is easy with ghostscript. something like
# gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dTextAlphasBits=4 -dGraphicsAlphasBits=4 -r300 -sOutputFile=teststep1.png $@
the part I need help with is that I want to change all pixels that are exactly cyan (1,0,0,0) into, say, rgb blue (0,0,1). just this exact color, not something related (like 0.99,0.01,0,0). is there a magick incantation that accomplishes this?
advice appreciated.
/iaw
change all pixels of one color to another?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: change all pixels of one color to another?
Exact may be a little difficult when one image is in one format CMYK, and the desired color is in another format RGB, really at some point either the image (pixels) or the color must be converted into a common format for the comparison to see if they match or match close enough (fuzz factor).
for pixel replacement see..
IM examples, Replacing Colors in Images
http://www.imagemagick.org/Usage/color_basics/#replace
for pixel replacement see..
IM examples, Replacing Colors in Images
http://www.imagemagick.org/Usage/color_basics/#replace
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: change all pixels of one color to another?
thanks. this may work...but when it expanded my 3MB pdf file to 100MB, I decided to skip it.
regards,
/iaw
regards,
/iaw
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: change all pixels of one color to another?
IM is a raster image processor, not a vector image processor (PDF is a vectro image file format)
A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vecto
A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vecto
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/