Issue #550 invalid

Image mask for neat effects

Anonymous avatarAnonymous created an issue

One can utilize grayscale images for neat effects such as screen transitions. I know pixel effects can achieve this, but not everyone supports them.

Comments (5)

  1. Alex Szpakowski

    From your link: "Although related (due to being used for the same purposes), transparent colors and alpha channels are techniques which do not involve the image pixel mixage by binary masking."

    Games made after the mid-90's typically utilize GPU blending coupled with an alpha channel, rather than bitwise operations. LÖVE's love.graphics.setBlendMode function exposes some of this functionality. Is there a specific effect you're trying to achieve that can't be done with the current blend modes? Maybe a new blend mode could be added, if the effect can be done that way.

  2. Minh Ngo

    Actually you can close this. I've considered the proposal to be poor because of my lack of understanding. Thank you for your clarification.

  3. Minh Ngo

    On second thought, I don't think any blend mode would accommodate what I'm thinking of. With transparency effect, it's possible to draw an image with transparency at the "top" so you can see things behind you.

    I'm imagining this more like a gingerbread cookie mold. The mold would be a black and white image mask. There can be a function where you set the mask on and all subsequent drawing operations would only show up on the white portion of the image mask.

    One good example I can think of is using a black and white text as an image mask. You can apply fancy text texture to it by drawing stuff afterwards.

    Pseudo code:

    imageMask = newImageMask(image)
    setImageMask(imageMask)
    drawStuff()
    

    Also, intermediate gray values between 0 and 255 would affect how transparent things can be when applying drawing operations on the mask. There could be a second argument for newImageMask where you specify a specific channel to check for transparency instead of luminance only.

  4. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.