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
Fix Texture2D.FromStream support for 1bit PNGs #6001
Comments
I suggest making StbSharp the default for all platform except consoles for now. Then remove all our old image loading code. |
That's the plan.
|
Maybe I misunderstood the discussion, but wanted to say that StbSharp is already integrated in the MG: https://github.com/MonoGame/MonoGame/tree/develop/MonoGame.Framework/Utilities/Imaging |
I did remember it had been done, but didn't find it. Probably because of the Utilities/Imaging directory. I'll extend the DesktopGL version of |
STB doesn't support TIF or DDS. Do we consider that much a loss? XNA supported PNG, JPG, GIF. STB supports PNG, JPG, GIF, BMP, PSD, TGA plus others that never get used in the real world. |
StbSharp is now used for all implementations of Texture2D.FromStream(GraphicsDevice, Stream), avoiding discrepancies with OS-provided image loading routines. As a result of this, DirectX platforms no longer support TIF or DDS through FromStream(). Added unit tests for loading 1-, 8-, 24- and 32-bit PNGs. Fixes MonoGame#6001
Added PR #6008 to fix this and use StbSharp for all implementations of |
@rds1983 If you update your StbSharp library, we could use ImageWriter for |
I think SaveAsPng already uses StbSharp, while SaveAsJpg uses TinyJpeg:
However I'll surely port latest stb_image_write.h as it'll allow to drop TinyJpeg. |
StbSharp is now used for all implementations of Texture2D.FromStream(GraphicsDevice, Stream), avoiding discrepancies with OS-provided image loading routines. As a result of this, DirectX platforms no longer support TIF or DDS through FromStream(). Added unit tests for loading 1-, 8-, 24- and 32-bit PNGs. Fixes MonoGame#6001
StbSharp is now used for all implementations of Texture2D.FromStream(GraphicsDevice, Stream), avoiding discrepancies with OS-provided image loading routines. As a result of this, DirectX platforms no longer support TIF or DDS through FromStream(). Added unit tests for loading 1-, 8-, 24- and 32-bit PNGs. Fixes MonoGame#6001
StbSharp is now used for all implementations of Texture2D.FromStream(GraphicsDevice, Stream), avoiding discrepancies with OS-provided image loading routines. As a result of this, DirectX platforms no longer support TIF or DDS through FromStream(). Added unit tests for loading 1-, 8-, 24- and 32-bit PNGs. Fixes MonoGame#6001
Ran across a 1bpp PNG image that our existing
Texture2D.FromStream
would not load.We should add this format to the unit tests and ensure it works.
You can download this white 1bpp texture here:
https://user-images.githubusercontent.com/103522/31480817-aafc0bde-aee5-11e7-9cb5-77491b4d3ae2.png
The text was updated successfully, but these errors were encountered: