Page 1 of 1
correct use of remap
Posted: 2013-01-05T18:06:13-07:00
by spongemonkey
I'm using using IM to do things related to printing so it's important that the hard work put into getting the image colours correct isn't undone by me messing everything up when I process them
I'm attempting to dither an image to a colour map (that will represent the possible ink combinations), but the result doesn't look right.
With this as my map (equally distributed colours in sRGB)
dithering the night scape sample
with the command
Code: Select all
convert.exe night_scape_orig.jpg -remap map.png night_scape_dithered.png
gives
which is clearly too light.
I guess problem is something akin to
this and I've been guessing at some solutions, but I'd like to know the definitive method?
Thanks a lot
Re: correct use of remap
Posted: 2013-01-05T20:52:47-07:00
by fmw42
My guess is that it is too light because your color map has too few gray colors. The darker one is too dark and the lighter one is too light. The algorithm chose the lighter one.
Also you might try adding +dither.
Re: correct use of remap
Posted: 2013-01-06T04:49:19-07:00
by spongemonkey
Thanks for the reply.
I'm afraid +dither is not an option, the image has to be dithered using Floyd-Steinberg or similar. Using a darker colour map doesn't seem to help either, and besides IM should be able to do better than that with the above map. There is clearly not enough black on the wall to the right of the picture, it just isn't even close. Which is why I believe I'm not using the feature correctly and it's something to do with colour spaces? I'm a bit wary about being too reckless with the -colorspace and -set colorspace options (seeing as im just guessing at the moment), as the base image will have it's colours very carefully defined with ICC profiles.
I do appreciate your input and you taking the time to reply though.
Re: correct use of remap
Posted: 2013-01-06T13:18:43-07:00
by fmw42
I really do not think it is a colorspace issue. Both images are already sRGB. Perhaps it is a dithering issue.
Re: correct use of remap
Posted: 2013-01-08T17:31:07-07:00
by spongemonkey
Does anyone have any more thoughts on this or want to come to the defense of the dithering results above?
Re: correct use of remap
Posted: 2013-01-08T18:40:03-07:00
by snibgo
spongemonkey wrote:... which is clearly too light.
spongemonkey wrote:There is clearly not enough black on the wall to the right of the picture, it just isn't even close.
Why do you think this?
It looks about right to me, and the average pixel values in various sampling of the wall are the same for the _orig and _dithered versions.
Re: correct use of remap
Posted: 2013-01-09T10:16:07-07:00
by snibgo
Of course, you might say, "I want more black pixels, even if that's not technically correct."
You could create a tone transformation curve that lowers the value of dark pixels while leaving brighter pixels unchanged. Apply this transformation before remapping:
Code: Select all
"%IMG%convert" ^
night_scape_orig.jpg ^
remap.ppm ^
-clut ^
-remap map.png ^
rem.png
Re: correct use of remap
Posted: 2013-01-15T18:30:01-07:00
by anthony
You probably should dither in linear colorspace. The map file is actually a linear-RGB colorspace map already.
Also you may like to increase teh dither tree-depth (-tree) Otherwise the dither function may not find the best color for the dither.