Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp-dog (animation)
#11
(04-27-2021, 02:28 AM)rickk Wrote:
(04-20-2021, 05:07 PM)rich2005 Wrote: For an animation ? A bash script. A simple loop, nothing complicated.
A long image long.png in this case 300 px high and 2000 px wide. The script is a moving 'window' 300x500 across that with a spacing set of 15 px. Makes a set of jpegs to load into Gimp.

Code:
#!/bin/bash

count=0
index=0
until [ $count -gt 1500 ]
do
   echo "$count"
   magick  long.png -crop 500x300+$count+0  "%d$index".jpg
   count=$(( $count + 15 ))
   index=$(( $index + 1 ))
done

Interestingly enough, I was just playing around with the  "Offset Layer"  function located in the layers menu, and it appears to offer a GUI "boilerplate" entry screen for  performing very much the same function. And surprisingly the key functionality was activated with fairly simple key combinations.

See my ofn-scroll-layer script Smile
Reply
#12
Depends what you want to do. All the script does is save a moving window as a series of images. It is quick, 180 images in a couple of seconds.  Not going to be that quick wrapping an image around with the offset filter.
As an animation and thinking of your other post some comparisons. 

   

From this using all the 180 frames
As a gif animation,  14.3 MB Not much optimisation with this type of image.
A webp using Gimp,  4.2 MB and lossy compression and took 1'30"
Using ffmpeg,  2.5 MB lossy compression and took a couple of seconds.

The ffmpeg webp: https://ibb.co/168RbYj
Reply
#13
(04-27-2021, 10:33 AM)Ofnuts Wrote: See my ofn-scroll-layer script Smile

Funny, but I was thinking of you last night, as I was laboring through all those repetitive key combinations.   Wink
Reply
#14
(04-27-2021, 12:00 PM)rich2005 Wrote: Depends what you want to do. All the script does is save a moving window as a series of images. It is quick, 180 images in a couple of seconds.  Not going to be that quick wrapping an image around with the offset filter.
As an animation and thinking of your other post some comparisons. 

You're absolutely right. And I wish that I had your skill and confidence in working with command-line programs. But from where I stand, the learning curve looks mighty steep.  (maybe some day I'll be near enough to where you are, sufficient that I'll feel comfortable getting something like that working. )

What I'm kinda working towards now is depicted in the following diagram, where the original image is the cross hatched area, expanding the canvas to include the blank background area to it's left, that will ultimately be the viewing area for the animation.

Selection made to include only the blank background area, and then using the offset filter to shove the image through the viewing area "X pixels" per iteration.  Doing a copy and export  for each.

[Image: TLuePWP.png]

Please excuse my poor representation of the marching ants. Smile

Is there an easy way to make the exported copies all layers in a separate new image?  That would be a real time saver.

(04-27-2021, 12:00 PM)rich2005 Wrote: As a gif animation,  14.3 MB Not much optimisation with this type of image.
A webp using Gimp,  4.2 MB and lossy compression and took 1'30"


I was noticing the other night how long lossy compression for WebP was taking.
I had a 320x240 animated GIF that was 400 frames long.....23.5 MB

Converting to non lossy WebP reduced the file size to 19 MB
Converting to lossy WebP  with a 90% quality factor, reduced the file size  to 8.9 MB, but took forever to complete.  So long in fact that I opened Gkrel to observe the CPU loading.  I've got a twin core Machine with hyperthreading, which appears as 4 cores to most bench marking software.   And, as the lossy compression was running, I observed that the task routing was not evenly shared among the CPUs.   at any given time one of the 4 would be peaked, while the other 3 were coasting. and  while the "peak" was moved around from core to core, at any given time the other 3 would be virtually dormant. Doesn't seem like an ideal implementation of multi-tasking .

Not sure if this was a Gimp thing, a Linux thing, an Intel firmware thing, or a Gkrel thing, but you'd suspect that more even loading might speed things up a bit?
Reply
#15
Just as a point, moving the image through the viewing window or moving the window across the image gives the same result.

Best stick to what you are comfortable with. I am sure that there are already plugins that do what you want (apart from ofnuts script)

Have a look here https://gimplearn.net/viewtopic.php?p=2079 as a starter.
Reply
#16
(04-27-2021, 04:29 PM)rich2005 Wrote: Just as a point, moving the image through the viewing window or moving the window across the image gives the same result.

Best stick to what you are comfortable with. I am sure that there are already plugins that do what you want (apart from ofnuts script)

Have a look here https://gimplearn.net/viewtopic.php?p=2079  as a starter.

As always, your input is appreciated!!
Reply
#17
Plenty nice examples using ofnuts plugin http://gimpchat.com/viewtopic.php?f=25&t...20#p249879
Reply
#18
(04-27-2021, 05:28 PM)rich2005 Wrote: Plenty nice examples using ofnuts plugin http://gimpchat.com/viewtopic.php?f=25&t...20#p249879

I'm going to HAVE to do something creative, ultimately my goal is to push an image that is 4,900 pixels wide, through an aperture 500 pixels wide....7 pixels at a time.   Dodgy
Reply
#19
Quote:....my goal is to push an image that is 4,900 pixels wide, through an aperture 500 pixels wide....7 pixels at a time.

That is 628 separate layers (or images) .. Wink I think a candidate for Imagemagick, unless someone can come up with a Gimp script.
Reply
#20
(04-28-2021, 11:00 AM)rich2005 Wrote: That is 628 separate layers (or images) ..  Wink I think a candidate for Imagemagick, unless someone can come up with a Gimp script.

It's not an absolute nightmare, the greater share of the work can be done with <contrl-shift-c> and <contrl-shift-v> key combinations, with <contrl-shift-f> to start each new iteration.

Assembling all the new separate images generated into a single, layered image gets a bit tedious...but I've suffered through worse.  Cool

Being able to save the master as an .xcf, so I can resume work as the notion suits me has been a big help.
Reply


Forum Jump: