You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QB64-PE uses stb_image & dr_pcx libraries to load all image files when requests are made using _LOADIMAGE.
Both stb_image and dr_pcx automatically de-palettizes the image on load. So, there is no way to tell what kind of color information these images had after the image data is received from these libraries.
So when the user loads a 24-bit image using _LOADIMAGE("my_image.jpg", 256), then:
The image is converted to 32bpp by stb_image while loading
Once we have the 32bpp data, _LOADIMAGE converts the image to 8bpp and applies ordered dithering
An adaptive palette is created or the image is remapped to QB64-PE master palette (depending on the _LOADIMAGEbpp parameter)
This results in an acceptable 8-bit image quality.
However, when the user loads an 8-bit palettized image using _LOADIMAGE("my_image.gif", 256), stb_imagede-palettizes the image and the same steps are applied to the data (as noted above). Hence, there are two side-effects:
The color palette is not the same compared to the original image it was loaded from
Some artifacts may be seen in the final image due to the ordered dithering step
The text was updated successfully, but these errors were encountered:
QB64-PE uses
stb_image
&dr_pcx
libraries to load all image files when requests are made using_LOADIMAGE
.Both
stb_image
anddr_pcx
automaticallyde-palettizes
the image on load. So, there is no way to tell what kind of color information these images had after the image data is received from these libraries.See nothings/stb#510 and nothings/stb#1124
So when the user loads a 24-bit image using
_LOADIMAGE("my_image.jpg", 256)
, then:stb_image
while loading_LOADIMAGE
converts the image to 8bpp and applies ordered dithering_LOADIMAGE
bpp
parameter)This results in an acceptable 8-bit image quality.
However, when the user loads an 8-bit palettized image using
_LOADIMAGE("my_image.gif", 256)
,stb_image
de-palettizes
the image and the same steps are applied to the data (as noted above). Hence, there are two side-effects:The text was updated successfully, but these errors were encountered: