Post Reply 

Help Creating a Script?

Oct 30, 2013, 08:32
Post: #1
Help Creating a Script?
So I have this project I'm doing in Gimp but it's very tedious. I'm thinking that I might be able to write a script to do it for me but I'm not sure. So I'm gonna explain the steps that I do and you guys can tell me if it can be done as a script.

So I take an image and I copy it to the clip board and then I change the image to grayscale and then back to rgb in order to remove the color from the layer (I know I can just desaturate but I prefer that method.). Then I paste in the copy so I have the grayscale layer on top and the original color layer on the bottom. and last I add an alpha channel to the grayscale layer.

Now here comes the tedious part. What I do is. I select the grayscale layer then make a selection that is the height of the image (Or the width depending on if the image is portrait or landscape and what I want) and about 75 pixels wide again depending on what I want the exact specifications to be. Starting and one end of the image. then I clear that selection so you see the color underneath. Then I flatten the image and save it as say Image 001.jpg. Then I undo the flatten and the clear and I move the selection over 1 pixel or 10 or however smooth I want to make the animation I redo the clear and the flatten and resave it again as Image 002.jpg. Doing this until I've gone across the entire image. Now if say the image was 2000 pixels wide then I would have to do 2000 images. See how that could be insane? So I was wondering if I could write a script to do that last part for me (the tedious select, clear, flatten, and then save over and over again) for me. Now I like to think I'm at least half smart about Gimp but if the way I'm doing it sounds crazy and insane and you guys can think of a better way then by all means let me know.


Thanks for any help anybody can give.
Find all posts by this user
Quote this message in a reply
Oct 30, 2013, 09:36
Post: #2
RE: Help Creating a Script?
Thanks for the advice sadly I don't know Scheme or Python. I know Gimp but not much into the area of Scripts.
Find all posts by this user
Quote this message in a reply
Oct 30, 2013, 19:24
Post: #3
RE: Help Creating a Script?
The scan should stay the same width and wrap around so it meets up with the first image so it looks like a continuous loop of sorts. I wanna be able to like select weather or not the image is landscape or portrait so that way the shortest side is the "fixed" length and I can enter a width for the scan. Like say if the image is 3000x2000 then it would automatically set the height to 2000 (the shorter side) and then I can input the width to say 75 or 5o or whatever and then it will just do its thing saving each image.
Find all posts by this user
Quote this message in a reply
Oct 30, 2013, 22:38
Post: #4
RE: Help Creating a Script?
Yeah that makes more sense. Like I said I'm not really a programmer.
Find all posts by this user
Quote this message in a reply
Nov 2, 2013, 03:56 (This post was last modified: Nov 2, 2013 04:31 by Captain_Cereal_Hands.)
Post: #5
RE: Help Creating a Script?
Thank you very much I will give it a go.

Your a genius it works perfectly. Quick question I know that Gimp can do animation cause I've done it before but do you think it could handle 2,000 images? I wouldn't set the individual duration for very long.
Find all posts by this user
Quote this message in a reply
Nov 2, 2013, 09:19
Post: #6
RE: Help Creating a Script?
(Nov 2, 2013 03:56)Captain_Cereal_Hands Wrote:  ...Quick question I know that Gimp can do animation cause I've done it before but do you think it could handle 2,000 images? I wouldn't set the individual duration for very long.

Here's my 2 cents

You could be a bug tester and report back to us your results if you want to try it.

*BUT, 2,000 pictures might be alot to process, so if it did work, it coud be slow.
No doubt the file size would be huuuge, regardless of the hieght x width of the images unless its maybe a thumbnail or less in size.


*
Before you start,
tweaking these factors might yield favorable results:
- What is your purpose for a large animation such as this? (stick figure animations are nice, I've seen some long ones, very simple animations)
- If its for a long tutorials, people will recommend you use a screen capture software
-Can you combine any of the 2,000 images to make the animation shorter? (dispose duplicates)
- Dont go crazy big with the dimensions of the images for the gif, anything around 320 x 120 might be good.
------------
Only other thing I can think of is if it would be possible to import 2,000 images to begin with or would gimp crash :\ hmmm, looking forward to your findings keep us posted Smile !

"In order to succeed, your desire for success should be greater than fear of failure." BC
[Image: 29uocaf.png]
iFS007 tut vids on YT ~ auto color B&W landscape tut
Visit this user's website Find all posts by this user
Quote this message in a reply
Nov 2, 2013, 10:15
Post: #7
RE: Help Creating a Script?
That is a nice little script from ofnuts, the effect is a little like a 'video wipe' without going from one image to another.

If you have problems with that large number of layers and Gimp then maybe try ImageMagick

Save the rendered png's to their own folder, working from that folder the basic IM command is

Code:
convert -delay 50 -loop 0 *.png ani.gif

That produces a big file so a slight modification to the command is

Code:
convert -delay 50 -loop 0 *.png -layers Optimize ani.gif

much smaller but can produce unexpected results depending on the images.

best of luck

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Nov 2, 2013, 20:50
Post: #8
RE: Help Creating a Script?
First of all I don't know if I'll get to testing the animation cause the plugin keeps crashing during the scan. I load the image and do the 2 layers then I go to the plugin and I select horizontal scan and then I set the increment to 1 pixel which concidering the image is 2,000 pixels wide should generate 2,000 images. Also I change the file extension to .jpg cause .png generates pictures that are 5Mb's each and jpg's are only like 600Kb's each. So I hit go and it always crashes at random points during the scan so idk...
Find all posts by this user
Quote this message in a reply
Nov 2, 2013, 22:37
Post: #9
RE: Help Creating a Script?
Thank you I will try it
Find all posts by this user
Quote this message in a reply
Nov 3, 2013, 02:16 (This post was last modified: Nov 3, 2013 02:18 by Captain_Cereal_Hands.)
Post: #10
RE: Help Creating a Script?
So the plugin still crashed. It got all the way up to like 240 and crashed. Oh well.
Find all posts by this user
Quote this message in a reply
Nov 3, 2013, 02:51
Post: #11
RE: Help Creating a Script?
It gave messages. I'll see if I can reproduce them.
Find all posts by this user
Quote this message in a reply
Nov 3, 2013, 04:27
Post: #12
RE: Help Creating a Script?
I re did it again and surprisingly it finished. Now on to try animating it.
Find all posts by this user
Quote this message in a reply
Nov 3, 2013, 07:04
Post: #13
RE: Help Creating a Script?
(Nov 3, 2013 04:27)Captain_Cereal_Hands Wrote:  I re did it again and surprisingly it finished. Now on to try animating it.
quoting this just to show I'm up to speed

(Nov 3, 2013 02:16)Captain_Cereal_Hands Wrote:  So the plugin still crashed. It got all the way up to like 240 and crashed. Oh well.

Do you mean the imported jpegs? You may have reached your limit memory-wise, anoteher program you could try is infraview in addition to the imagick(not sure on spelling) mentioned by somebody earlier.
Visit this user's website Find all posts by this user
Quote this message in a reply
Nov 3, 2013, 16:14
Post: #14
RE: Help Creating a Script?
No I meant when using the scan plugin to create the jpeg's it crashed at 240 but now for some reason it worked so I have all 2,000 jpeg's and I will be trying to animate them.
Find all posts by this user
Quote this message in a reply
Nov 5, 2013, 01:33 (This post was last modified: Nov 5, 2013 01:35 by Captain_Cereal_Hands.)
Post: #15
RE: Help Creating a Script?
So I start the whole process with a new image (started clean). This image is 1500x1000. I did a vertical scan at 5 step and it generated 300 images. I was able to successfully do a animation in gimp with all 300 layers. The image came out to 203Mb's. So yes I would have to do it as a movie if I wanted full one pixel step (which I plan on trying). Btw once I got all 300 layers loaded in to the gimp file I saved a copy in the Gimp format and the file is 1.25Gb's.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Problems with a bat script :( ThaUnknown_ 1 305 Mar 26, 2018 21:14
Last Post: paynekj
  Script-fu ordered file list vnicent 1 147 Mar 19, 2018 17:33
Last Post: paynekj
  script-fu argument/parameter formats dhugg 2 248 Mar 13, 2018 00:50
Last Post: dhugg
  Request for script chlebna 1 411 Sep 13, 2017 09:35
Last Post: ythgilb
  Request for script - Guillotine + Watermark sunslick 1 471 Sep 4, 2017 08:51
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS