-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image assets have lost detail #3896
Comments
@GravisZro image converter is not part of the MuditaOS. Therefore it's not a bug to the OS. |
Saying that - I believe you are right that the software used is lacking in this aspect. (Not OSS right now, link for reference for people with access) |
I would like to request that you cease being dismissive. I have tried to bring this up before but you closed the issue and ignored my request to reopen the issue. It is extremely irritating to put in the effort to report and fix flaws in the project only to be ignored and dismissed. Neglecting community efforts is self-defeating. With this issue in particular, I explicitly stated in the description of this issue (and the previous issue) that the cause of this loss of detail is a lack of color quantization. |
This actually hurt, as we lost quite a lot of time reaching out to you, I believe this is the origin of this particular issue, where you at the beginning introduced code that was crashing - into the perfectly working codebase (for the current needs), which was found out by unit tests you denied writing. So first and foremost - please do your best to help us out. It's not our goal to provide support and have nothing from it. Saying that I'm sorry to hear that you feel that way, it was not my intention. I actually am very fond of community, when the question arose "shall we OSS" I always advocate for yes, and always promote that we open how much we can. I understand that your findings feel the most important to you, but to us, it's just a tiny bit of scope. Please drop the personal remarks as it's not getting us anywhere, be as supportive as you can and help us out instead of adding weight on our backs. |
I recognize that a sizeable chunk of the time that has been invested in accommodating community members, myself especially and I'm grateful for it. As for the unit testing, I would gladly contribute tests if I had a better insight into the codebase as well as catch2 and I'm continuing to work on these. I'm quite glad you to have an advocate for open source in Mudita and I hope you continue pushing for it despite any setbacks. I apologize as my intent was not to harm but it seems my frustrations/concerns were improperly presented which is why I opened multiple github issues to present them properly so they may be addressed in a neutral manner. |
@GravisZro It's being internally processed right now. Repo will be opened in the nearest future. |
Hi @GravisZro , Feel free to contribute :) |
🐛 Bug report
📝 Description
The tools used to generate the VPI files are discarding details from the source PNG images. Specifically, the colors have not been quantized which results in loss of detail.
👍 Expected behavior
I expected the source image color palette to be quantized so that values like
#0D0D0D
are converted to01
.👎 Current behavior
As far as I can tell, when converting from 24-bit RGB in the PNG the bottom 20-bits are simply discarded.
🔬 Minimal reproduction
This is a step-by-step process used to dump PNG pixel values using nothing but normal tools:
The extra ubuntu/debian packages required are
bsdextrautils
(for hexdump) andnetpbm
(for pngtopam).hexdump
output format string. It's just a 16-bit address followed by 32 groups of 3-byte RGB data (i.e. "xxxx | RRGGBB (repeat RRGGBB 31 more times)").plus_32px_W_G.png
is printed to standard outputpngtopam
reads the PNG stream and prints out the image as a binary 24-bit Portable PixMap image. No colors are manipulated in any way, they are written as is. (Note: If you add-plain
to the command it will print out as an ASCII 24-bit Portable PixMap image which is a very human readable format.)tail
only takes the last line to remove the header data which states the dimensions and image typehexdump
convert to the binary data stream to ASCII, printing in a format specified in Psed
with 3 regular expression to make the output readable.So here we see that the point of each axis is
BD 0D 0D BD
. When the colors are quantized to 4-bit, they should be translated to0B 01 01 0B
.So all we need to do is find out the value of the pixels on the fifth row in the VPI image.
I'll point out how the VPI is decoded using a hexdump of the VPI file itself.
hexdump
output format string. It's just a 16-bit address followed 8 bytes, a space, and 8 more bytes.hexdump
ofplus_32px_W_G.vpi
with output format specified in$P
0x0000
- two bytes: width: 320x0002
- two bytes: height: 320x0004
- one byte: transparency: 0x100x0005
- two bytes: Line 1 vector count : 1 vector0x0007
- 1 vector * 4 bytes per vector (ignored)0x000C
- two bytes: Line 2 vector count : 1 vector0x000E
- 1 vector * 4 bytes per vector (ignored)0x0011
- two bytes: Line 3 vector count : 1 vector0x0013
- 1 vector * 4 bytes per vector (ignored)0x0017
- two bytes: Line 4 vector count : 1 vector0x0019
- 1 vector * 4 bytes per vector (ignored)0x001D
- two bytes: Line 5 vector count : 5 vectors0x001F
- two bytes: vector offset: 00x0021
- one byte: vector run-length: 14 pixels (0x0E)0x0022
- one byte: vector color: 0x0F0x0023
- two bytes: vector offset: 00x0025
- one byte: vector run-length: 1 pixel0x0026
- one byte: vector color:0x0B
0x0027
- two bytes: vector offset: 00x0029
- one byte: vector run-length: 2 pixels (0x02)0x002A
- one byte: vector color:0x00
(Detail lost! Expected 0x01)0x002B
- two bytes: vector offset: 00x002D
- one byte: vector run-length: 1 pixel0x002E
- one byte: vector color:0x0B
So manually decoding the data shows that the pixels that should be
0B 01 01 0B
are actually0B 00 00 0B
. This is a loss of detail.The text was updated successfully, but these errors were encountered: