Closed RSViewMan closed 1 year ago
I have not looked in detail at your sketch, but the bad output image suggests the image render program is correctly identifying the pixels as 16 bit and the pixel count is correct. However the colours are either 1. not being interpretted correctly by the image display program or 2. pixels have not beem endcoded correctly.
Black is being correctly interpretted but this is a value of 0 and ths to be expected. I would check if your display program can handle 565 encoded pixels as it may be interpretting them as 4444 ARGB. There online tools that will convert an image to 565 BMP format so maybe test your image display program with the converted output file from that: https://online-converting.com/image/convert2bmp/
If those steps do not reveal a problem then I would do a binary compare of a simple small image composed of solid red, green, blue, black and white blocks. You could then compare the output of your image converter with the output from the online tool.
Bodmer - Thanks for the quick reply. I did a test using Red, Orange, Purple, Cyan and Blue JPEG files -- All tests created valid BMP files on the SD that accurately represented the source. I will continue to look at the data output. Thanks again.
Bodmer - Your library is awesome!! -- Thank you for publishing it.
I am attempting to save a decoded JPEG to BMP565 directly to SD and am having an issue with the color mapping not being correct. Refer to the sample screen shots below. The original JPEG is 1200x1600 and the Scale factor is 4. I have tried different scales w/o any change in the output (other than size). I have hard coded everything below to alleviate any possibility of a looping error or boundary miscalculation. I thought maybe there was a byte misalignment in the file but the BMP Row Data ends on an even 4 byte boundary -- which appears to be a necessity of the BMP format. The tjpgdcnf.h file is set for 565 Decoding (default setting).
The JPEG renders to a TFT display w/o any issues using your TFT Library -- the quality is great and the picture is clear.
Any input you could give regarding how to correct the BMP file conversion would be appreciated. Thanks.