image icon indicating copy to clipboard operation
image copied to clipboard

`r,g,b,a` values of monochrome images

Open adil192 opened this issue 1 year ago • 1 comments

This is the image I'm trying to parse: View-Details-256 I've zipped it up to avoid any possible GitHub compression: View-Details-256.zip


My app (Saber) inverts images using the image package. You can see the changes I made to debug this issue here:

image

The only information printed to the console is the following, which tells us that the alpha channel isn't being parsed properly (it's 255 for all pixels)...

flutter: invertImageIsolate
flutter: format: Format.uint8 2

This is also demonstrated in the outputted images:


In fact, the unique pixel values I can see in the decoded image are (the alpha value is always 255)... rgb(0,0,0), rgb(255,223,0), rgb(255,255,0), rgb(255,191,0), rgb(255,167,0), rgb(255,128,0), rgb(255,112,0), rgb(255,159,0), rgb(255,139,0), rgb(255,96,0), rgb(255,84,0)

From this, I believe that, e.g. in rgb(255,191,0), r=255 should be r,g,b=255 and g=191 should be a=191 if that makes sense?

adil192 avatar Feb 23 '23 02:02 adil192

I haven't had a chance to look at it yet, but my suspicion is that the images are 2 channel luminance-alpha images and yeah, I don't think I handle them in a good way. It's probably currently putting the two channels into RG rather than RA.

brendan-duncan avatar Feb 23 '23 03:02 brendan-duncan