[FIXED] Hue filter issue

Hi!

We are trying to use the hue filter on a uniform color image in order to add some color customization to our game. We have used photoshop to find wanted hue values for the image. The problem is that there seems to be a slight problem with the colors when they are in the app. It looks like some of the colors are darker than we expect them to be when finding the values in photoshop. We can reproduce this effect in photoshop by also turning the lightness of the image down when adjusting the hue.

We also noticed that the corona hue filter will change the color of white in images while the photoshop hue filter does not tune the color of black or white in images. Though we solved this by using the hue filter on a uniform color image.

Does anyone have an explanation for this or have experienced something similar? Is this even a good way of doing this? Is this a known issue that different programs have differently behaving hue functions?

Thanks!

EDIT: The corona hue filter changes the color of the white in an image, not that black as I first stated.

Hi @Reaver,

Are you seeing these differences on a device or on the Simulator? Can you post some screenshots to compare?

Thanks,

Brent

Hi Brent!

I tested on the device and simulator and the results look the same. I have also a couple of images for you.

This is the image as it appears in GIMP with hue set to -170.

cvTpn2f.png

This is the image of how it is displayed with Corona with the same hue value.

7bqbGf8.png

As you can see the Image has a different color and the parts of the image that were white are effected by the hue filter which it does not do in GIMP and Photoshop.

Original Image: 

8ATxKch.png

Code:

local image = display.newImage("hue.png") image.x = 150 image.y = 350 local hueValue = -170 image.fill.effect = "filter.hue" image.fill.effect.angle = hueValue

Hi @Reaver,

Engineering is taking a look at this. Thanks for posting the screenshots.

Brent

@Reaver: Tomorrow’s daily build (CoronaSDK 2014.2298) will include a fix for filter.hue that will bring our results closer to GIMP and Photoshop.

Thanks for reporting this problem!

Albert

Thanks for looking into this!

Hi again.

I just had a look at this and it seems that the colors match better but that the sign needs to be switched for the hue value found in photoshop and GIMP. So if a specific color has hue value 50 in PS or Gimp then the color can be found by using -50 as the hue value in corona.

Hi @Reaver,

Are you seeing these differences on a device or on the Simulator? Can you post some screenshots to compare?

Thanks,

Brent

Hi Brent!

I tested on the device and simulator and the results look the same. I have also a couple of images for you.

This is the image as it appears in GIMP with hue set to -170.

cvTpn2f.png

This is the image of how it is displayed with Corona with the same hue value.

7bqbGf8.png

As you can see the Image has a different color and the parts of the image that were white are effected by the hue filter which it does not do in GIMP and Photoshop.

Original Image: 

8ATxKch.png

Code:

local image = display.newImage("hue.png") image.x = 150 image.y = 350 local hueValue = -170 image.fill.effect = "filter.hue" image.fill.effect.angle = hueValue

Hi @Reaver,

Engineering is taking a look at this. Thanks for posting the screenshots.

Brent

@Reaver: Tomorrow’s daily build (CoronaSDK 2014.2298) will include a fix for filter.hue that will bring our results closer to GIMP and Photoshop.

Thanks for reporting this problem!

Albert

Thanks for looking into this!

Hi again.

I just had a look at this and it seems that the colors match better but that the sign needs to be switched for the hue value found in photoshop and GIMP. So if a specific color has hue value 50 in PS or Gimp then the color can be found by using -50 as the hue value in corona.

Using build 2393, the “filter.hue” produces substantially different colors for iOS (7.1, iPhone 5) and for Android. fill.effect.angle = 200 produces red on iOS and army green on Android (4.4.3, Nexus 7).

Are colors supposed to be consistent across platforms?

@Dotnaught: The result of the hue filter should be the same across platforms. Can you file a bug with a simple sample? Please make sure your sample uses the texture giving you the incorrect result. Having a bug on file will help us track the issue and schedule some time to fix it. Thanks!

Was there ever a bug filed for this? We were just about to launch an update to our app that included hue adjustment of images. Worked great on iOS, nexus4, nexus 5, nexus 7 gen 2, but doesn’t work as expected on Nexus 7 gen 1. (Even setting hue to 0 on nexus 7 gen 1 results in a green image from a base orange one). This is preventing us from adding this required feature and I am worried this could happen randomly on any of the other many types of Android devices. Could we get an update please?

Posted Bug (Case 35892) for this.

Easiest reproducable case is to load an image, set hue filter to it and set the hue angle to 0.

On Nexus 4,5, 2nd gen 7 and iphone ipad etc works as expected (image looks “normal”)

On Nexus 1st gen the image has a hue adjustment to it.

Not sure how many other devices would be affected, but assuming it would not just be isolated to Nexus7 1st Gen.

Using build 2393, the “filter.hue” produces substantially different colors for iOS (7.1, iPhone 5) and for Android. fill.effect.angle = 200 produces red on iOS and army green on Android (4.4.3, Nexus 7).

Are colors supposed to be consistent across platforms?

@Dotnaught: The result of the hue filter should be the same across platforms. Can you file a bug with a simple sample? Please make sure your sample uses the texture giving you the incorrect result. Having a bug on file will help us track the issue and schedule some time to fix it. Thanks!

Was there ever a bug filed for this? We were just about to launch an update to our app that included hue adjustment of images. Worked great on iOS, nexus4, nexus 5, nexus 7 gen 2, but doesn’t work as expected on Nexus 7 gen 1. (Even setting hue to 0 on nexus 7 gen 1 results in a green image from a base orange one). This is preventing us from adding this required feature and I am worried this could happen randomly on any of the other many types of Android devices. Could we get an update please?