Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Overlay Blend Mode
Started by farjadfarabi_czs Jan 06 2016 06:36 PM

5 replies to this topic
overlay blend composite capturescreen
[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

farjadfarabi_czs

[GLOBAL: userInfoPane.html]
farjadfarabi_czs
  • Enthusiast

  • 97 posts
  • Corona SDK

Hi guys,

 

I am trying to accomplish a photoshop style overlay blend mode. And thus I was wondering if there is a way to use the composite.overlay effect on a combination of a display object and an image. Right now, as I understand it, a composite effect requires two images? However, I am planning on using one image and one display object (lets say display.newCircle). So how could I implement an overlay composite effect using one image and one display object? 

 

I guess I could display.save() to save the display object and then use it as an image, but that would be too much. Is there an easier way to achieve this? Or any other way to achieve an overlay blend mode ?

 

Thank you.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

You could save your display.newCircle out then load it back in as an image.

 

Rob



[TOPIC: post.html]
#3

farjadfarabi_czs

[GLOBAL: userInfoPane.html]
farjadfarabi_czs
  • Enthusiast

  • 97 posts
  • Corona SDK

Thanks Rob. That's what I was thinking, but was wondering if there would be an easier/straightforward way. I guess some  way is better than no way. 



[TOPIC: post.html]
#4

roboward

[GLOBAL: userInfoPane.html]
roboward
  • Enthusiast

  • 50 posts
  • Corona SDK

Is there no way we can get composite effects capable of using display objects, instead of just images?

 

local compositePaint = {

type="composite",
paint1={ type="camera" },
paint2={ type="displayObject", myDisplayImage }
}

 

object.fill = compositePaint

object.fill.effect = "composite.colorDodge"

 

That would be ideal. (And been around as an "open possibility" for a couple years). 

 

Or, could some of the other modes be added to blendmode ?  (overlay, difference, subtract, pinlight, etc.)



[TOPIC: post.html]
#5

farjadfarabi_czs

[GLOBAL: userInfoPane.html]
farjadfarabi_czs
  • Enthusiast

  • 97 posts
  • Corona SDK

You could save your display.newCircle out then load it back in as an image.

 

Rob

 

Hi Rob, 

 

I was wondering how to load the Image back? because the parameter filename within the composite effect only accepts a name of the file and it defaults to to ResourceDirectory.

local compositePaint = {
type="composite",
paint1={ type="image", filename="image01.png" },
paint2={ type="image", filename="texture.png" }
} 

But if I save a display object it will be saved in DocumentsDirectory. So is there a way to change the directory of the composite effect so DocumentsDirectory ?  

 

paint1={ type="image", filename= "system.DocumentsDirectory/Image.png" }, tried doing this but no result.

 

Thanks.



[TOPIC: post.html]
#6

farjadfarabi_czs

[GLOBAL: userInfoPane.html]
farjadfarabi_czs
  • Enthusiast

  • 97 posts
  • Corona SDK

Okay I figured it out. 

 

You can just do

 

paint1={ type="image", filename= "Image.png", baseDir=system.DocumentsDirectory }




[topic_controls]
[/topic_controls]