When I set alpah parameter to 1, some colors lose
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
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
@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
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.
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.