Post subject: Image editing: How to copy-paste layers automatically?
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Short question: How to copy-paste a pile of images into another pile of images automatically? Elaborated question: Let's say I have two folders containing image files (in PNG format). The first folder is called "backgrounds" and contains a few hundred images named in numbers: 0.png, 1.png, 2.png... The second folder is called "front layers" and contains a few hundred (transparent) images named in numbers: 0.png, 1.png, 2.png... I would like to combine the images from these two folders together, so that all the "front layer" images are pasted as front layers onto the corresponding "background" images. These combined images would then be either saved in a third folder called "finished images" or just overwrite-saved to the existing "backgrounds" folder. It could be done manually, but I would like to know if there is a way to automatize the process. I can make some simple scripts for GIMP, but I can't quite handle multiple files at once and save them accordingly. Any scripting help would be appreciated and any kind of solution to the problem will suffice. Are there other programs than GIMP that might provide this kind of functionality? It's a simple task, but laborious to do by hand. As always, helpful posts might be rewarded with a few thousand rerecords.
Tub
Joined: 6/25/2005
Posts: 1377
needs bash and imagemagick, replace 123 with the number of images you have.
for i in $(seq 0 123) ; do
  composite "front layers/$i.png" "backgrounds/$i.png" "finished images/$i.png"
done
m00
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Thanks a lot, Tub! I'll test it sometime soon.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Tub wrote:
needs bash and imagemagick, replace 123 with the number of images you have.
for i in $(seq 0 123) ; do
  composite "front layers/$i.png" "backgrounds/$i.png" "finished images/$i.png"
done
Works in zsh as well. Moreover, in zsh you can do it like:
for ((i=0; i<124; ++i)) composite "front layers/$i.png" "backgrounds/$i.png" "finished images/$i.png"
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Thanks guys. I'm a lousy Windows user, so I had to install some exotic ports to try those things and it turned out to be a bit cumbersome process. In other words:
seq: command not found
Oh, by the way, I happen to have PHP installed. So, what might a corresponding PHP script look like?
Tub
Joined: 6/25/2005
Posts: 1377
<?php
for ($i=0;$i<123;$i++)
   system("composite "front layers/$i.png" "backgrounds/$i.png" "finished images/$i.png");
?>
m00
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Oh dear, I'm sorry, but now there's some problem when I try to run the PHP script:
parse error, unexpected T_STRING in script.php on line 3
I have tried modifying the script in many ways without success. Imagemagick itself is working wonderfully, by the way. Thanks for showing it to me.
Joined: 3/7/2006
Posts: 720
Location: UK
<?php
for ($i=0;$i<123;$i++)
   system("composite \"front layers/$i.png\" \"backgrounds/$i.png\" \"finished images/$i.png\"");
?>
Voted NO for NO reason
Post subject: Geek level-up!
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Ok, I got what I wanted. Everything is working perfectly now and this saves many hours of my time. Thank you. I'm going to spend those saved hours in experimental Gens TASing, so as a reward for helpful posts, Tub, Warp and LagDotCom, each of you can now choose one game from this page: http://tasvideos.org/ListofIdeas/Genesis.html I'll play all three games through normally and then I pick one of them and start TASing it for a few thousand rerecords. P.S. LagDotCom, don't ask me to improve King's Bounty this time!
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3598)
Joined: 11/3/2004
Posts: 4738
Location: Tennessee
My vote is on Golden Axe 2 or 3.
It's hard to look this good. My TAS projects
Post subject: This is TASVideos, hee hee...
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
Votes don't matter.
Tub
Joined: 6/25/2005
Posts: 1377
oops, sorry about that. I obviously didn't test the script :) I've played Cannon Fodder on the Amiga a lot, but I don't know if the Genesis version is any good. Lacking a mouse it probably isn't. Not sure if it'd be interesting to watch either. So you might as well use adelikat's suggestion ;)
m00
Joined: 3/7/2006
Posts: 720
Location: UK
That list is slightly out of date (there is an ECCO movie, etc.) I wanted to say Chaos Engine, but it's not... wait, *looks for Soldiers of Fortune* no that isn't there either. Bah. From that list I'd most like to see Rings of Power, because I have no idea how to play that game.
Voted NO for NO reason
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
LagDotCom wrote:
That list is slightly out of date (there is an ECCO movie, etc.)
There is a movie for Ecco the Dolphin, but "Ecco: The Tides of Time" is a different game. There is no published movie for the latter. Anyway, the list may contain some mistakes, so please continue notifying any suspicious seeming thing there, thanks.
LagDotCom wrote:
I wanted to say Chaos Engine, but it's not... wait, *looks for Soldiers of Fortune* no that isn't there either. Bah.
It is there, on the "not working" tab. The graphics are not emulated correctly in that game. Ok, LagDotCom's choice is Rings of Power and Tub got Golden Axe 2 & 3. Warp can still choose the fourth one.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Aqfaq wrote:
I'm a lousy Windows user, so I had to install some exotic ports to try those things and it turned out to be a bit cumbersome process. In other words:
seq: command not found
Then you should have used the 'for ((i=0; i<=123; ++i)); do <the command>; done' form (with bash). (Btw, I still can't understand why it seems that 99.9% of linux users prefer bash over zsh. What is it in bash that makes it so good? What is it in bash that zsh doesn't have? I could list a ton of things zsh does have which bash doesn't. Whenever you ask some linux user something about the shell, it's *always* bash, only bash and nothing but bash. I don't remember *ever* seeing anyone (besides myself) even mentioning zsh as an alternative. Yet in my experience zsh is so much more advanced than bash.)
Tub
Joined: 6/25/2005
Posts: 1377
I don't *prefer* bash, I just deem bash good enough for my needs, and everywhere I log in (home, university, root server, ..) there's a shell that's either bash or bash compatible. Getting used to zsh-specific functions wouldn't do me much good.
m00
Editor, Expert player (2460)
Joined: 4/8/2005
Posts: 1573
Location: Gone for a year, just for varietyyyyyyyyy!!
LagDotCom wrote:
From that list I'd most like to see Rings of Power, because I have no idea how to play that game.
Hey, maTO has made a nice TAS through that game in slightly over 2 hours. You can find his run here: http://www.freewebs.com/suklaalevy/files/megadrive/