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

Can't convert PNG transparent #1

Open
maclovin opened this issue Sep 19, 2021 · 0 comments
Open

Can't convert PNG transparent #1

maclovin opened this issue Sep 19, 2021 · 0 comments

Comments

@maclovin
Copy link

maclovin commented Sep 19, 2021

I've been trying to convert some texture files (PNG with transparency) but there's some issues with conversion from transparent pixel to desired pixel recolour.

Theres the script output:

$ python3 main.py -f DOOM2/AGB128_1.png -m CGA
Traceback (most recent call last):
  File "/Users/thx1139/lab/Bitcrush/main.py", line 125, in <module>
    main()
  File "/Users/thx1139/lab/Bitcrush/main.py", line 120, in main
    commandline_process(fname, args)
  File "/Users/thx1139/lab/Bitcrush/main.py", line 93, in commandline_process
    img.adjust(args.adjust[0], args.adjust[1])
  File "/Users/thx1139/lab/Bitcrush/bitcrush.py", line 105, in adjust
    i = ImageEnhance.Brightness(img).enhance(b_factor)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/ImageEnhance.py", line 36, in enhance
    return Image.blend(self.degenerate, self.image, factor)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/Image.py", line 3067, in blend
    return im1._new(core.blend(im1.im, im2.im, alpha))
ValueError: image has wrong mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant