Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp animation player is also a filter??
#1
My first post here. 

I use the Gimp animation player quite a bit to test animations. I've noticed two things recently.

Arrow  The animation player ignores dim backgrounds on transparent (alpha) layers.
This looks like a 'foreground extract' filter that appears to be coded-in. It could work as a stand alone filter.

Arrow  Also there is an icon in the top menu that says 'detach the animation from the dialogue window'.
I'm not sure what this actually does. Any ideas?
Reply
#2
Welcome to gimp-forum.net

(03-08-2018, 11:46 AM)Tas_mania Wrote: I use the Gimp animation player quite a bit to test animations. I've noticed two things recently.

Arrow  The animation player ignores dim backgrounds on transparent (alpha) layers.
This looks like a 'foreground extract' filter that appears to be coded-in. It could work as a stand alone filter

Best guess, alpha in a gif is either on or off. Maybe the player observes that.

Quote: Arrow  Also there is an icon in the top menu that says 'detach the animation from the dialogue window'.
I'm not sure what this actually does. Any ideas?

Nothing in the Gimp docs. Another guess, want to play the animation on your desktop without the window decorations. Detach, minimise the player window.

[Image: OWhfI0V.jpg]
Reply
#3
rich2005Welcome to gimp-forum.net

Thanks rich2005.
This is a way of showing what I found:

   

   

Above is a frame with an alpha channel and below is how the Gimp animation player displays it.
I'm using Gimp 2.8.22. I actually like the way animation player displays it because it could clean-up animations for me.
If only it was a filter Sad
Reply
#4
Could have done with an actual frame, however for lots frames, devolved into individual images maybe a bash script using ImageMagick. For an individual image.

Code:
convert input.png -channel A -fx "p*(p>0.3?1:0)" result.png

Comes from here: https://www.imagemagick.org/discourse-se...hp?t=31582

A made up test: https://i.imgur.com/ZRYC7Va.jpg
Reply
#5
Thanks rich2005.
It looks like the animation player acts like a filter on transparent layers.

Code:
convert input.png -channel A -fx "p*(p>0.3?1:0)" result.png

Here is an explanation of the script from the link you posted:
"uses "-channel A" to work on just the alpha channel. It checks each pixel to see if it's alpha value is greater than 30%. If it is, it multiplies the pixel's alpha value by 1 which leaves the transparency as it was. If the pixel's alpha value is 30% or less it multiplies the value by 0, which results in changing that to a fully transparent pixel.

I notice there is a option to apply a script to all layers in gimp-gap 'fillter all layers'. I will try it there first.

Sorry I didn't post the actual layer.
This is the video I was making when I noticed how animation player processes alpha channel layers.
https://www.youtube.com/watch?v=FgfJfJMe...e=youtu.be


The animations are made with MathMap Composer which gives them a life of their own Smile
Reply
#6
When it comes to lots of images (frames) I tend to think IM first, but I did look at Gimp possibilities.

The Gimp levels tool using the alpha channel can 'cancel' faint marks. Reducing the gamma setting to a small value, < 0.4  seems to get rid of them. That can be scripted. A simple one-liner as a python plugin attached.

That will act on all layers in a stack, could be much more sophisticated, needs one of the clever guys if it 'sort-of-works' with your animations. Have to be careful with the entered value, higher values remove edge anti-aliasing.


Attached Files
.zip   clear_alpha.py.zip (Size: 439 bytes / Downloads: 176)
Reply
#7
Wow! The python script works perfectly. I found it in Gimp > Tools > clearalpha

I set the slider to 30% and it extracted just the foreground from 360 layers.

This is exactly what I was looking for. Smile 

Something to remember is that Gimp animation player does this by default but only in the player, not the actual layers.
It's only when I exported as an AVI that I could see it worked.

Congratulations Rich.
Its a pity gimpscripts is not functional at the moment because we do need a script repository.
Reply
#8
(03-11-2018, 08:01 AM)rich2005 Wrote: A simple one-liner as a python plugin attached.

Welcome to the club Smile
Reply
#9
(03-11-2018, 12:59 PM)Ofnuts Wrote:
(03-11-2018, 08:01 AM)rich2005 Wrote: A simple one-liner as a python plugin attached.

Welcome to the club Smile

No, I will leave it to you clever guys.

Still trying to get my old FORTRAN programs to work, Keep feeding the punched cards into the DVD drive but nothing happens  Wink
Reply
#10
(03-11-2018, 01:06 PM)rich2005 Wrote: Still trying to get my old FORTRAN programs to work, Keep feeding the punched cards into the DVD drive but nothing happens

I'm trying to get my Basic programs to work, but when I type GO TO it says invalid Sad
Reply


Forum Jump: