Skip to content
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

Save TGA with Compression / RLE #6545

Closed
SmittyWerbenJJ opened this issue Aug 29, 2022 · 1 comment · Fixed by #6546
Closed

Save TGA with Compression / RLE #6545

SmittyWerbenJJ opened this issue Aug 29, 2022 · 1 comment · Fixed by #6546
Labels

Comments

@SmittyWerbenJJ
Copy link

SmittyWerbenJJ commented Aug 29, 2022

In the Documentation we have no information about how to apply compression for TGA files. It just states that it is possible,but not how to do it.

https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html?highlight=tga#tga

TGA
Pillow reads and writes TGA images containing L, LA, P, RGB, and RGBA data. Pillow can read and write both uncompressed and run-length encoded TGAs.

Now I find for other file formats we have the option to set compression="someValue" while calling Image.save(), to define file compression.

The only hint on how to use this, I found from this test case which calls for rle=rle and it actually works

original_im.save(out, rle=rle)

Is this the only way to do TGA compression? Is this not written in the documentation (I could not find it)?

@radarhere
Copy link
Member

You can use the compression argument.

im.save(out, compression="tga_rle")

I've created PR #6546 to add this to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants