Repository navigation
PNG saves go through pngio; remove pygraphics' own encoder - #38
Merged
Merged
Conversation
encode_png, write_png_file and FrameBuffer.to_png are gone. save_image writes PNG through pngio (built into PyDevices MicroPython firmware; pydevices-desktop over Pillow on CPython) and raises a clear ImportError when it isn't there. RGB888 framebuffers now save as PNG instead of writing nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brad's ruling for the media program: PNG comes out of pygraphics and lives in pngio (micropython-pydevices modules/pngio on MicroPython, pydevices-desktop's Pillow wrapper on CPython), so an app saves PNG the same way on both.
This removes
encode_png,write_png_fileandFrameBuffer.to_pngfrom the pure package and both native bindings, with no compatibility shim.save_image(fb, "x.png")now encodes through pngio, and if pngio isn't installed it raises an ImportError that says what to install. RGB888 framebuffers save as PNG, which also fixes the old path that wrote nothing for them.Tested here: the pure and native CPython suites pass with pngio from pydevices/utils, and a unix MicroPython built with
--modules pygraphics,pngiosaves a PNG that decodes back pixel for pixel. This change is meant for the next pygraphics release.