This is what I'm trying to do:
For each color channel in an 24bit RGB image, replace all values below 16 with 16 and all values above 235 with 235.
What I tried:
I made a color lookup table ("clut.pgm", one row, 256 values). No values under 16 or above 235 are included in the table, all other values are sequential (example 8->16, 21->21, 45->45, 240->235).
I ran it through convert:
Code: Select all
convert 01429_sunsetinedinburgh_1280x800.jpg clut.pgm -clut output.png
Code: Select all
convert 01429_sunsetinedinburgh_1280x800.jpg clut.pgm -clut clut.pgm -clut output.png
Is this a bug? It has nothing to do with input/output formats (I tried). Any other ways to do with I'm trying to do?
EDIT: Sample data is available here.
EDIT2: ... and I found the solution myself. My CLUT was wrong (0x0D 0x0A in PGM instead of 0x0D) :-/. Duh... Can any moderator delete this thread?
..