0

I created an 8-bit .tiff image ("test.tiff") containing a grid of 30 different color patches in the RGB color space using ImageMagick -convert.

When I convert this image into a jpeg (which is what I need) using:

convert -quality 100 -colorspace RGB -depth 8 test.tiff test.jpg

The identify -verbose command reveals that the resulting jpeg has several additional colors in the color table, each only taking up a few (1-4) pixels and residing very near the desired colors in RGB space. My assumption is that some kind of border bleeding is happening; maybe due to compression?

I don't understand why this border bleeding has occurred, especially given that it does not occur when I convert the tiff image to either a bmp or pcx image.

Thank you

BDA
  • 65
  • 1
  • 6

2 Answers2

1

By definition, JPEG is a lossy compression. The effects your experiencing are expected with the JPEG format. Setting the -quality of 100 will not have a 1-to-1 image result as tiff.

See additional answers:

[...] because every time [JPEG] would save it it would generate some changes.

At [quality] 100, you just get the LEAST loss possible.

Community
  • 1
  • 1
emcconville
  • 23,800
  • 4
  • 50
  • 66
0

I don't know how you created your 30 colour swatch, or how your histogram looks, but you might try adding -dither None and -colors 30 options to your convert commands:

convert test.tiff -dither None -colors 30 ...
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Same result as before. Must be due to compression, as pointed out by @emcconville – BDA Oct 15 '14 at 20:59