Login
Back to forumSee the full topicGo to last reply

Posted By

IstvanV
on 2008-01-08
17:24:20
 Re: So I want to do plus/4 gfx...

The conversion is fairly simple. It first converts the input image to YUV format, and finds optimal pairs of luminance values from the 9 possible levels for each 8x2 block, finds the best horizontal shifts (running the luminance code search in a loop, and choosing the shift values that give the least amount of error), and generates bitmaps with ordered or diffuse dithering. There are 6 different methods for calculating the luminance error and finding the best values, this can be selected on the command line.
Only when that is all done is the color (U and V) information converted, taking into account that the color resolution is lower than the luminance resolution (there is both horizontal blur and averaging with the previous line - the result usually looks much worse if this filtering effect is ignored by using the '-pal 0' command line flag). For each 8x2 block, a pair of color values is searched for the non-black pixels, to minimize U and V error; non-grey colors can be interlaced with the nearest hue.
This simple approach of trying to create the best possible greyscale image first and then adding colors to it tends to work reasonably well in image areas where luminance changes and color changes occur at the same time (e.g. bright yellow vs. dark green), but is not very good when there are only hue or saturation changes within a single 8x2 block.



Back to top


Copyright © Plus/4 World Team, 2001-2024