Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is there a way to simulate the "saturation" blending mode from Photoshop?
Started by pouwelsjochem8 May 25 2018 12:46 AM

5 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

pouwelsjochem8

[GLOBAL: userInfoPane.html]
pouwelsjochem8
  • Enthusiast

  • 96 posts
  • Corona SDK

Hi all,

 

I'm not much of an OpenGL guy myself, so I would like to ask if anyone knows if it is possible to simulate the effect of the "saturation" blendMode which exists in Photoshop?

 

Photoshop describes it as: Creates a result color with the luminance and hue of the base color and the saturation of the blend color. Painting with this mode in an area with no (0) saturation (gray) causes no change.

 

I'm looking for a method either with a custom shader applied to the sprite, or by creating a custom blendMode (which I guess is not possible to such extend?)



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,913 posts
  • Enterprise

[TOPIC: post.html]
#3

pouwelsjochem8

[GLOBAL: userInfoPane.html]
pouwelsjochem8
  • Enthusiast

  • 96 posts
  • Corona SDK

Have you looked at saturation filter yet?

 

https://docs.coronalabs.com/guide/graphics/effects.html#filter.saturate

 

Rob

Yes I am aware of that filter, it does work slightly different than the "saturation" blendingMode though. The blendingMode would offer partial saturation and saturating specific channels. At first I did require this, but due to changed requirements the 'filter.saturate' will also work for me. :)



[TOPIC: post.html]
#4

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 500 posts
  • Corona SDK

You might be able to achieve what you are looking for with composite effects, however, composite filters don't currently support sprite sheets.  Still, take a look.

 

You might also be able approximate some Photoshop-like saturations with these filters:

 

colorPolynomial

 

colorMatrix

 

monotone

 

all of which, I believe, should work with sprite sheets.



[TOPIC: post.html]
#5

pouwelsjochem8

[GLOBAL: userInfoPane.html]
pouwelsjochem8
  • Enthusiast

  • 96 posts
  • Corona SDK

Well I have been able to achieve my desired effect with 'filter.saturate' since that filter has exactly the same result as a black or white overlay with the 'saturation' blendMode.

 

But now I have encountered some other blendModes which would also be very useful in my game. These are 'Hard Light', 'Vivid Light' 'Color Dodge' and 'Color'. Since composite effect won't do the the job, would it be possible to use custom defined shaders with the color it should blend with baked in? (since all I try to achieve is to let it blend with a specific color)



[TOPIC: post.html]
#6

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 500 posts
  • Corona SDK

I think you can approximate most of those effects with filters.  They have different names but some of the effects are similar.  Also try using two identical objects with different filter effects stacked on top of one another - each at 0.5 alpha.  The background behind the two images can add additional effects so then you have even more variables to play with.

 

Try swapping the top and bottom images.  The bottom image can also be 1.0 alpha depending on the effect you want.  


Edited by sporkfin, 29 May 2018 - 03:13 PM.



[topic_controls]
[/topic_controls]