Page 1 of 1
change the color of a single specified pixel
Posted: 2010-07-18T03:55:43-07:00
by melisen
Hi all.
I want to change the color of a single specified pixel and save the result in another file.
So far I have managed to change a specified pixel to black
Code: Select all
convert /Users/anders/Desktop/teest2.png -draw ‘color 395,324 point' /Users/anders/Desktop/teest3.png
But how do I specify which color I want the pixel to be?
Re: change the color of a single specified pixel
Posted: 2010-07-18T08:20:39-07:00
by el_supremo
Precede the -color command with
-fill yellow
or
-fill rgb(255,255,0)
which with a Q8 IM will also be yellow, or equivalently,
-fill rgb(100%,100%,0)
which will do the same thing in Q8 and Q16.
Pete
Re: change the color of a single specified pixel
Posted: 2010-07-18T09:09:20-07:00
by melisen
Do you mean
convert /Users/anders/Desktop/teest2.png -draw -fill yellow ‘color 395,324 point' /Users/anders/Desktop/teest3.png
?
I have tried but no luck. I have tried a number of variations that didn´t work either:
convert /Users/anders/Desktop/teest2.png -draw -fill yellow ‘color 395,324 point' /Users/anders/Desktop/teest3.png
convert /Users/anders/Desktop/teest2.png -draw '-fill yellow color 395,324 point' /Users/anders/Desktop/teest3.png
convert /Users/anders/Desktop/teest2.png -draw '-fill yellow 395,324 point' /Users/anders/Desktop/teest3.png
convert /Users/anders/Desktop/teest2.png -fill yellow 'color 395,324 point' /Users/anders/Desktop/teest3.png
Re: change the color of a single specified pixel
Posted: 2010-07-18T09:40:51-07:00
by el_supremo
Sorry, I don't know how I got that so drastically wrong.
I meant before the -draw:
Code: Select all
convert /Users/anders/Desktop/teest2.png -fill yellow -draw ‘color 395,324 point' /Users/anders/Desktop/teest3.png
Pete
Re: change the color of a single specified pixel
Posted: 2010-07-18T21:04:56-07:00
by anthony
-fill is done outside -draw inside -draw use 'fill' Don' forget the quotes, -draw only takes one argument.
Code: Select all
-fill yellow -draw 'color 395,324 point'
or
Code: Select all
-draw 'fill yellow color 395,324 point'
NOTE: their is a difference between 'point 395,324' and 'color 395,324 point' The first is overlay the color, the second is replace the color.But this is only if drawing transparent colors....
See Im Examples Draw 'Color Fill Primatives'
http://www.imagemagick.org/Usage/draw/#color