Page 2 of 2

Re: Getting the color of a pixel

Posted: 2018-09-20T17:17:39-07:00
by snibgo
We can also use expressions for the coordinates, eg:

Code: Select all

-transparent %[pixel:p{0,h-1}]
"hex:" also works for me. In Windows, "#" isn't a special character so we don't need quotes (but they are harmless). What are the tradeoffs for "hex:" versus "pixel:"? "Hex:" always rounds HDRI values to integers, and clamps values, eg:

Code: Select all

f:\web\im>%IMG7%magick xc:gray(150%) -format %[pixel:p{0,0}] info:
gray(150%)

f:\web\im>%IMG7%magick xc:gray(150%) -format #%[hex:p{0,0}] info:
#FFFFFFFFFFFF
Any other difference between "hex:" and "pixel:"?

Re: Getting the color of a pixel

Posted: 2018-09-20T17:19:44-07:00
by fmw42
Good point about hex rounding for HDR and also about using h-1.

Re: Getting the color of a pixel

Posted: 2018-09-20T19:48:26-07:00
by dholcomb9711
Thanks, guys! You all rock!

It's nice to learn as I move along. I am so much more comfortable using IM than I was 3 months ago because of community help.