System Window Mask Stack (Keyhole effect for stack with Windowshape)
I’m trying to create a stack which I place in front of stacks which contain browser objects and camera controls in order to mask them and create more interesting shapes for the video and browser content. The only way to do this I believe is to have a stack - let’s call it a “System Window Mask” stack - and punch holes though it. A stack level keyhole effect. Scott if you are there I need your help :) This stack of Scotts shows the result: • go url "http://www.tactilemedia.com/download/animated_mask.livecode"; And I’d like a way to generate those masks from graphic objects that I place on the “System Window Mask” stack - then export a snapshot - my experiments so far are failing. I can get a polygon to make the stack with code like this: • export snapshot from graphicObject with effects to img”mask” of me as PNG • set the windowshape of stack stackName to imageID But I’d like to reverse the effect - so I get a hole in the shape of the graphic. Code like this: -- set the ink of graphicObject to "blendDstIn" -- set the ink of myGroup to "blendSrcOver" Before taking the snapshot is not cutting it? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
The Group thing is kind of how Illustrator used to create masks. Not sure anymore I’ve been out of Illustrator for years now. Bob S > On Apr 15, 2020, at 12:02 PM, Richard Gaskin via use-livecode > wrote: > > Whenever I fail to add, "...or seemingly so based on 22 years of experience > in delivering applications with LiveCode, but of course notwithstanding the > full scope of all possible things one might try given infinite time", please > consider that implied. :) > > I'm not the first person to have work stopped on a feature when the older > inks were removed. > > Monte's suggestion, and you your explanation, are very helpful. I've passed > them along to another developer I know who held up some of their own work > when the method they'd been using was no longer available. > > The new inks are indeed quite good, and the group trick is a very helpful key > to unlocking how to use them well. Thank you. > > > > Just to explain why the group is necessary - if a group has the > > 'blendSrcOver' ink applied then it becomes a 'transparency group'. > > > > This means it has its own alpha channel which can be affected by the > > 'destination alpha modifying' porter-duff operations. So in this case: > > > >1) The group is a transparency group so allocates its own > > transparent buffer > >2) The image is composited into the buffer > >3) The mask is then composited into the buffer with the DstIn ink. > > This means that the destination buffer alpha is adjusted so it is only > > 'in' the mask (an analog of ANDing the buffers alpha channel with the > > mask's alpha channel - indeed, previously I'm guessing you would have > > done this using some sort of AND bitwise ink and being careful with > > colors used). > >4) The buffer is then composited with the background. > > > > The transparency group thing is needed partly for efficiency and > > partly because you can't remove alpha from an opaque destination > > - which a window provides. > > > > Hope this helps! > > > > Mark. > > -- > Richard Gaskin ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
Mark Waddingham wrote: > On 2020-04-15 02:30, Richard Gaskin via use-livecode wrote: >> Monte Goulding wrote: >> >>> If I understand what you want correctly then: >>> >>> Create image >>> Create mask object >>> Group both >>> Set the ink of the mask object to blendDstIn >>> Set the ink of the group to blendSrcOver >> >> Super, Monte. That works well. >> >> I was up late with a tool I'd made to let me walk through all sorts >> of combinations, but I hadn't thought to group them. > > Oh look, clearly the 'useful' inks haven't really been removed - > they've just been replaced with the modern equivalents which give > much better fidelity results ;) Whenever I fail to add, "...or seemingly so based on 22 years of experience in delivering applications with LiveCode, but of course notwithstanding the full scope of all possible things one might try given infinite time", please consider that implied. :) I'm not the first person to have work stopped on a feature when the older inks were removed. Monte's suggestion, and you your explanation, are very helpful. I've passed them along to another developer I know who held up some of their own work when the method they'd been using was no longer available. The new inks are indeed quite good, and the group trick is a very helpful key to unlocking how to use them well. Thank you. > Just to explain why the group is necessary - if a group has the > 'blendSrcOver' ink applied then it becomes a 'transparency group'. > > This means it has its own alpha channel which can be affected by the > 'destination alpha modifying' porter-duff operations. So in this case: > >1) The group is a transparency group so allocates its own > transparent buffer >2) The image is composited into the buffer >3) The mask is then composited into the buffer with the DstIn ink. > This means that the destination buffer alpha is adjusted so it is only > 'in' the mask (an analog of ANDing the buffers alpha channel with the > mask's alpha channel - indeed, previously I'm guessing you would have > done this using some sort of AND bitwise ink and being careful with > colors used). >4) The buffer is then composited with the background. > > The transparency group thing is needed partly for efficiency and > partly because you can't remove alpha from an opaque destination > - which a window provides. > > Hope this helps! > > Mark. -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
On 2020-04-15 02:30, Richard Gaskin via use-livecode wrote: Monte Goulding wrote: If I understand what you want correctly then: Create image Create mask object Group both Set the ink of the mask object to blendDstIn Set the ink of the group to blendSrcOver Super, Monte. That works well. I was up late with a tool I'd made to let me walk through all sorts of combinations, but I hadn't thought to group them. Oh look, clearly the 'useful' inks haven't really been removed - they've just been replaced with the modern equivalents which give much better fidelity results ;) Just to explain why the group is necessary - if a group has the 'blendSrcOver' ink applied then it becomes a 'transparency group'. This means it has its own alpha channel which can be affected by the 'destination alpha modifying' porter-duff operations. So in this case: 1) The group is a transparency group so allocates its own transparent buffer 2) The image is composited into the buffer 3) The mask is then composited into the buffer with the DstIn ink. This means that the destination buffer alpha is adjusted so it is only 'in' the mask (an analog of ANDing the buffers alpha channel with the mask's alpha channel - indeed, previously I'm guessing you would have done this using some sort of AND bitwise ink and being careful with colors used). 4) The buffer is then composited with the background. The transparency group thing is needed partly for efficiency and partly because you can't remove alpha from an opaque destination - which a window provides. Hope this helps! Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
Monte Goulding wrote: > If I understand what you want correctly then: > > Create image > Create mask object > Group both > Set the ink of the mask object to blendDstIn > Set the ink of the group to blendSrcOver Super, Monte. That works well. I was up late with a tool I'd made to let me walk through all sorts of combinations, but I hadn't thought to group them. Thanks! -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
Brian Milby wrote: > On Tue, Apr 14, 2020 at 5:32 PM Richard Gaskin wrote: > >> Back in the day I could easily make a sort of keyhole effect, in >> which I used one graphic to obscure an image, and a second graphic >> on top as a mask to define a shape (such as a keyhole) through >> which I could see a portion of the image. >> >> It was done easily enough with inks. >> >> Inks that, it seems, we no longer have. >> >> So given the subset of inks we're now limited to, has anyone here >> seen firsthand an example of this in LC v9.x? > > > We had a discussion in 2018 about using a hex shaped grc to split up > an image (started by Richmond). The key line there was: > > set the backPattern of grc "hex" to the ID of img "box" > > Since attachments and stacks were involved, I'm pretty sure it took > place on the forums. I'm not sure if this will accomplish what you're > looking for though. I can send a stack off list if you'd like to see > it. Thanks, but the solution I'm looking for has to use inks. I'm open to other things, but the mask needs to be a circle so a polygon is out, and backpattern won't work because of a bug/unsupported use (see the fine print in the Dictionary about the specific dimension requirements for backPattern, which turned out to be a problem for us). So inks it is. If it's possible now that the good inks are gone. -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
If I understand what you want correctly then: Create image Create mask object Group both Set the ink of the mask object to blendDstIn Set the ink of the group to blendSrcOver Like everything else graphical I’m sure Scott Rossi has a better way ;-) Cheers Monte > On 15 Apr 2020, at 7:31 am, Richard Gaskin via use-livecode > wrote: > > Back in the day I could easily make a sort of keyhole effect, in which I used > one graphic to obscure an image, and a second graphic on top as a mask to > define a shape (such as a keyhole) through which I could see a portion of the > image. > > It was done easily enough with inks. > > Inks that, it seems, we no longer have. > > So given the subset of inks we're now limited to, has anyone here seen > firsthand an example of this in LC v9.x? > > -- > Richard Gaskin > Fourth World Systems > Software Design and Development for the Desktop, Mobile, and the Web > > ambassa...@fourthworld.comhttp://www.FourthWorld.com > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Keyhole effect?
We had a discussion in 2018 about using a hex shaped grc to split up an image (started by Richmond). The key line there was: set the backPattern of grc "hex" to the ID of img "box" Since attachments and stacks were involved, I'm pretty sure it took place on the forums. I'm not sure if this will accomplish what you're looking for though. I can send a stack off list if you'd like to see it. On Tue, Apr 14, 2020 at 5:32 PM Richard Gaskin via use-livecode < use-livecode@lists.runrev.com> wrote: > Back in the day I could easily make a sort of keyhole effect, in which I > used one graphic to obscure an image, and a second graphic on top as a > mask to define a shape (such as a keyhole) through which I could see a > portion of the image. > > It was done easily enough with inks. > > Inks that, it seems, we no longer have. > > So given the subset of inks we're now limited to, has anyone here seen > firsthand an example of this in LC v9.x? > > -- > Richard Gaskin > Fourth World Systems > Software Design and Development for the Desktop, Mobile, and the Web > > ambassa...@fourthworld.comhttp://www.FourthWorld.com > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Keyhole effect?
Back in the day I could easily make a sort of keyhole effect, in which I used one graphic to obscure an image, and a second graphic on top as a mask to define a shape (such as a keyhole) through which I could see a portion of the image. It was done easily enough with inks. Inks that, it seems, we no longer have. So given the subset of inks we're now limited to, has anyone here seen firsthand an example of this in LC v9.x? -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode