-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Can't convert images with height / width < 64 to jpeg2000 #3161
Comments
Reproducible with Pillow 5.1.0 on Python 3.6.5 and Python 2.7.15 on macOS High Sierra. |
any update on this? |
Reproducible with Pillow 5.3.0 on Python 3.5.2 on Ubuntu 16.04. |
I can't replicate this. I would guess that it's been fixed in OpenJPEG, but to check, @hugovk since you were able to reproduce this previously, could you give it another try? |
Cannot reproduce with macOS Mojave 10.14.5, latest Pillow 6.1.0 and openjpeg stable 2.3.1: ⌂115% 1z [hugo:/tmp/Downloads] % p
Python 3.7.4 (default, Jul 9 2019, 18:13:23)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> Image.open('image.jpeg').save('image.jp2', 'JPEG2000', quality_mode='dB', quality_layers=[41])
>>>
⌂82% 1z [hugo:/tmp/Downloads] 8s % p2
Python 2.7.16 (default, Mar 4 2019, 09:02:22)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> Image.open('image.jpeg').save('image.jp2', 'JPEG2000', quality_mode='dB', quality_layers=[41]) The output |
Thanks |
If anyone else is still experiencing this and would like it looked into further, feel free to comment and this can be re-opened. |
Reproducible with Pillow 8.2.0 on Python 3.7.5 on MacOS Catalina 10.15.7 |
Using the image from the original post? Or another one? |
I've found that OpenJPEG is trying to tell us that "Number of resolutions is too high in comparison to the size of tiles". I find that setting from PIL import Image
image_path = "small.jpeg" # image size is 18 x 28
save_file_path = "test.jp2"
image = Image.open(image_path)
image.save(save_file_path, 'JPEG2000', num_resolutions=5) |
I've created PR #5540 to fix the default behaviour of Pillow. |
What did you do?
I am trying to convert a jpeg image of size 63x47 to jpeg2000
What did you expect to happen?
Expected a jp2 image as output. However this issue doesn't happen if both the height and width of the image >= 64
What actually happened?
What versions of Pillow and Python are you using?
Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.
The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.
Attaching the image I am trying to convert.
The text was updated successfully, but these errors were encountered: