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

How to get webp transparency? #506

Open
fagsoft1 opened this issue Sep 1, 2020 · 11 comments
Open

How to get webp transparency? #506

fagsoft1 opened this issue Sep 1, 2020 · 11 comments

Comments

@fagsoft1
Copy link

fagsoft1 commented Sep 1, 2020

I've been using webp for my images but when I try to used for an image with a transparent background, the image gets a white background instead.

So, is there any configuration to set transparency for webp?

Thanks.

@anzaHanza
Copy link

I am stuck at the sam issue as fagsoft1.
How can we get transparency for webp?

Thanks.

@vstoykov
Copy link
Collaborator

I'll be happy to review a PR for that.

@ckcollab
Copy link

ckcollab commented Apr 6, 2022

Seems fixed by using a later version of pilkit (that seems like it could use a release!)

I added this to my requirements.txt:

git https://github.com/matthewwithanm/pilkit.git@09ffa2ad33318ae5fd3464655c14c7f01ffc2097#egg=pilkit

Woo! Glad to have fixed this on our project! django-imagekit going to save a lot of time, ty for the work on this.

@fabgarsan
Copy link

Seems fixed by using a later version of pilkit (that seems like it could use a release!)

I added this to my requirements.txt:

git https://github.com/matthewwithanm/pilkit.git@09ffa2ad33318ae5fd3464655c14c7f01ffc2097#egg=pilkit

Woo! Glad to have fixed this on our project! django-imagekit going to save a lot of time, ty for the work on this.

Hi!, could you confirm with is the last version of pilkit? I'm using the 2.0 and is not still working @ckcollab

@ckcollab
Copy link

ckcollab commented Apr 11, 2022

Yeah, like I mentioned: I think they could use a new release!

Will have to install from a SHA until a release is done @fabgarsan

@fabgarsan
Copy link

Yeah, like I mentioned: I think they could use a new release!

Will have to install from a SHA until a release is done @fabgarsan

Done, but it is not working. Maybe I have something wrong or missing? this is what I have:

    logo_webp = ImageSpecField(
        source='logo',
        format='WEBP',
    )

Thanks for your help!

@ckcollab
Copy link

Not sure man, probably a mistake on your end somewhere. I'd examine your environment and confirm proper pilkit installed (by comparing code on github, or something)

@XFaost
Copy link

XFaost commented Jul 2, 2022

@ckcollab
I have the same problem.

image_medium = ProcessedImageField(
        upload_to='cars',
        processors=[ResizeToFit(604, 604)],
        format='PNG',
        options={'quality': 60},
        verbose_name='Photo')
image_medium_webp = ImageSpecField(
        source='image_medium',
        processors=[ResizeToFit(604, 604)],
        format='WEBP',
        options={'quality': 60})

I have no problem with png images, but webp has a white background.

Windows 10, 64x
Python 3.10

requirements.txt

asgiref==3.5.2
certifi==2022.6.15
charset-normalizer==2.1.0
Django==4.0.5
django-admin-sortable2==2.1
django-appconf==1.0.5
django-filter==22.1
django-imagekit==4.1.0
djangorestframework==3.13.1
idna==3.3
Markdown==3.3.7
pilkit==2.0
Pillow==9.2.0
psycopg2==2.9.3
python-decouple==3.6
pytz==2022.1
requests==2.28.1
six==1.16.0
sqlparse==0.4.2
typing_extensions==4.3.0
tzdata==2022.1
urllib3==1.26.9

@ckcollab
Copy link

ckcollab commented Jul 2, 2022

Try this:
#506 (comment)

@XFaost
Copy link

XFaost commented Jul 2, 2022

@ckcollab Done, it is working! Thank you!

@hgaron-blockbar
Copy link

Yeah, like I mentioned: I think they could use a new release!
Will have to install from a SHA until a release is done @fabgarsan

Done, but it is not working. Maybe I have something wrong or missing? this is what I have:

    logo_webp = ImageSpecField(
        source='logo',
        format='WEBP',
    )

Thanks for your help!

Did you resolve your issue? I too am having the same issue and I have pilkit installed from SHA.

pilkit = {editable = true, ref = "09ffa2ad33318ae5fd3464655c14c7f01ffc2097", git = "https://github.com/matthewwithanm/pilkit.git"}.

Curious if any steps you took to resolve might help me resolve as well.

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

7 participants