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

When I set alpah parameter to 1, some colors lose #7

Open
gonghao opened this issue Apr 1, 2014 · 4 comments
Open

When I set alpah parameter to 1, some colors lose #7

gonghao opened this issue Apr 1, 2014 · 4 comments

Comments

@gonghao
Copy link

gonghao commented Apr 1, 2014

I met an strange question which is that I compressed an UIImage to WebP, but some colors lose, and I also try to use other quality and WEBP_PRESET but fianlly I find the problem is casued by ALPHA parameter. I tried use other numbers less than 1 all are correct. And I try to edit some source code:

if (alpha <= 1) {
    image = [self webPImage:image withAlpha:alpha];
}

to enforce call webPImage:withAlpha method first and will fix this problem. I don't why, so could you help to fix this issue?

THX

@seanooi
Copy link
Owner

seanooi commented Apr 2, 2014

I might need to run more tests to make sure it works well with most images, but can you provide a screenshot? It seems to be working fine on my end. This is the screenshot I have.
http://i.imgur.com/1ItYyX3.png
Alpha is 1.0 for the top image, and 0.5 for the bottom image

@gonghao
Copy link
Author

gonghao commented Apr 12, 2014

@seanooi Hi, I make some tests, when I use iPhone Simulator 7.1 64-bit, it looks very nice. But when I switch to my iPhone 5s, the terrible thing comes.

https://www.dropbox.com/s/l1tmxkgensosq4f/IMG_2631.PNG
Here is my screenshot, the top image use Alpha 0.99999, the bottom use 1.f

@seanooi
Copy link
Owner

seanooi commented May 24, 2014

I took a closer look at it and noticed the if (alpha <= 1) statement isn't really needed. I will run more tests but it'll most probably be taken out of future releases.

@ThePragmaticArt
Copy link

Yeah, same thing is happening to me. Removing the if alpha <= 1 clause corrects the issue when the alpha is one. Otherwise, I consistently get a blue hue on all converted images.

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

3 participants