nanogui: Jpeg images and dithering
Subject:
Re: [nanogui] Jpeg images and dithering
From:
tj ####@####.####
Date:
3 Nov 2005 01:04:20 +0000
Message-Id: <43696151.4070300@comcast.net>
It turned out the problem was
#define FASTJPEG 1
in device.h. This forced libjpeg routines to use 256 colors instead of
65535.
Defining as 0 solved the problem.
tj
Greg Haerr wrote:
>: I am using nano-x on a 220x176 color lcd with MWPF_TRUECOLOR565 frame
>: buffer configuration. The problem is graphics are being dithered. In
>: looking at the problem I have one really big question. None of the RGB
>: values can be a full 8 (255 decimal) bits, red is 5, green is 6 and blue
>: is 5 maximum bits respectivly. So, how does either nano-x or libjpeg,
>: which ever one does it, get them to the 565 format correctly?
>
>When nano-X is presented with an RGB color (that is, 8/8/8),
>it uses the COLORVALTOPIXELVAL macros in mwtypes.h
>to convert this to 5/6/5 format. As you mention above, all
>8 bits can't fit in 565 format, so macros convert the color
>by shifting left 3 or 2 bits and packing them into a 16-bit word.
>
>When nano-X decodes an image, it is converted into an internal
>MWIMAGEHDR format, which is decoder-specific. I think
>we ask the jpeg decoder to convert an image to a 24-bit color
>value. When images are displayed, they have to then be converted
>to the hardware (in your case 565) format.
>
>So the dithering issue is likely when outputing the 888 MWIMAGE
>to 565 format, although that doesn't preclude the jpeg decoder
>from doing something silly. This can be checked by converting
>the image externally, and using a different decoder in nano-X.
>
>Of course, if you're running in palette mode, then things are
>quite a bit different.
>
>Regards,
>
>Greg
>
>
>
>:
>: In my welcome screen I have large area that is GR_RGB(255, 168, 167), in
>: nano-x'ese, with all RGB values larger than the 565 limit. On the screen
>: it pretty much matches the pc screen color, but it is dithered with
>: white, and maybe other colors.
>:
>: So, my real question is can somebody tell me how colors larger then the
>: 565 pattern are "mapped" to the actual colors as seen on the screen. And
>: where that transformation takes place, in nano-x or libjpeg.
>:
>: Thanks,
>: tj
>:
>:
>: ---------------------------------------------------------------------
>: To unsubscribe, e-mail: ####@####.####
>: For additional commands, e-mail: ####@####.####
>:
>:
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>
>
>
>