Page 1 of 1

Crop an image. Few pixels color changed.

Posted: 2018-10-29T04:11:17-07:00
by HosinaTomoko
Hi.
I used convert to crop the margins.
But some pixels have changed color. (That part is one color)

1. use convert.exe on command line
convert [IMAGE] -crop 20x439+760+9 -format "%c" histogram:info:

2. actual result
20: ( 25, 32, 58) #19203A srgb(25,32,58)
8748: ( 25, 32, 60) #19203C srgb(25,32,60)
12: ( 25, 32, 61) #19203D srgb(25,32,61)

* expected result = 8780: ( 25, 32, 60) #19203C srgb(25,32,60)

3. so i checked entire pixel
convert [IMAGE] -crop 20x439+760+9 -format "%c" txt:

4,23: (6425,8224,14906) #19203A srgb(25,32,58)
5,23: (6425,8224,14906) #19203A srgb(25,32,58)
...
2,35: (6425,8224,15677) #19203D srgb(25,32,61)
3,35: (6425,8224,15677) #19203D srgb(25,32,61)
...

---------------------------------------------------

I wonder what causes this result.
And how do i get the results I want?
(need more crop option / image problem / etc...)


Image


ps. I crop the margin using WINDOWS PAINT and the tested it. No problem.
8780: ( 25, 32, 60) #19203C srgb(25,32,60)

Re: Crop an image. Few pixels color changed.

Posted: 2018-10-29T06:41:40-07:00
by snibgo
Have you posted the actual file you used in your command? The posted file is a JPEG, which is useful for photographs, but is lossy and areas of flat constant colour do not remain constant.

JPEG should not be used if you expect certain colours to be present.