GIMP Chat
http://gimpchat.com/

Creating specific layer / visualisation filter
http://gimpchat.com/viewtopic.php?f=9&t=16889
Page 1 of 1

Author:  Ivorne [ Wed Sep 26, 2018 9:46 am ]
Post subject:  Creating specific layer / visualisation filter

Hello,
I am making a game. And I am trying to implement an interesting animation method using a bitmap created in Gimp and a shader program. The way it works is that each pixel of the bitmap can be either fully white or fully black in a specific moment. I have up to 256 frames of animation. And the pixel will be rendered white if pixel.r <= frame < pixel.g. So red channel tells us the frame in which the pixel becomes visible and green channel tells us when the pixel becomes invisible again. So each pixel can be visible only once during the animation.

So what I need to do is to have a plugin for Gimp that lets me view specific animation frame. But I want that view to update automaticaly whenever I change the image. So it could work somewhat like a layer mode or an attached layer effect. The effect needs to receive frame number from 0 to 255. If it were something like a layer effect, I would expect it to be given in a dialog box. If it were something like extra layer mode, the frame number could be taken from layer color (or brightness).

Could you give me some advice how to best approach this intent of mine? Compatibility of the saved xcf file with vanilla Gimp is not important to me. I just would like your oppinions on how this could be done the easiest. Of course the hardest part of this will be the fact that I need it to update every time the image changes.

Thank you,
Ivorne

Author:  ofnuts [ Wed Sep 26, 2018 10:18 am ]
Post subject:  Re: Creating specific layer / visualisation filter

Threshold the green and blue channels with the frame index (one is threshold above, one is threshold below), and compose them (lighten only mode). This gives you a map of the visible pixels for the frame. Apply as a layer mask to an image restricted to the red channel.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/