Batch image processing

This forum is currently in read-only mode.
From the Asset Store
Surena system
$126 USD
30% off
A system for storing and processing information online
  • ***I'm suggesting this unaware of any way to do it in Construct, so please forgive me if this is already possible in the software***

    Doing this one-by-one can be very time consuming. For example, I have 150 images that I'm cleaning up the backgrounds of in Construct. Once I'm done I'll have to export all 150 images one-at-a-time into GIMP where I can batch resize/batch crop the images... then I'll have to import them back into Construct.

    Now you may ask, why not just do all of that in GIMP? Well, the reason I do it Construct is because it allows me to play the animation and determine which frames I need (or don't need), and allows me to eye-test them in motion which I don't believe can be done in GIMP. Basically, it's always easier to do these things all in one program.

    We're already able to batch import images for animations in Construct... so, might batch image editing (batch resizing/batch cropping) and batch image exporting be made an available feature in future versions of Construct?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • http://docs.gimp.org/en/plug-in-playback.html

    http://www.gimp.org/tutorials/Basic_Batch/

    Not sure what you need to do to "clean up" your images, but I'd be willing to bet its doable in Gimp.

  • Thanks, newt. I had no idea about the GIMP animation previewer.

    I already have a GIMP plug-in for batching, though.

    But the issue that remains is, in Construct you're able to set the animation speeds separately for each frame and each character, and set it to buttons so you see the movement progressions... it gives us a 100% accurate test since it's in the game. You can't do that in GIMP, so even if you preview each frame in GIMP, it won't be 100% the same in Construct when/if you make mods to the animation frames in Construct.

  • Most of my stuff is drawn in another program, but I can see the need for batch processing because of the need for accurate animation testing of your changes. Having to switch back and forth between programs is a bit annoying.

    The more you can do all in one program, the better.

  • You can use a canvas and image manipulator to do most of that automatically.

    Resize the sprite to whatever you want in the layout editor or at runtime and put a canvas over the sprite. Have an event:

    for 1 to 150 (number of frames)

    Trigger once

    • Sprite: set animation frame to loopindex
    • canvas: clear to transparent
    • paste sprite to canvas
    • send canvas's image to image manipulator using copy from Sprite (works with canvases)
    • save as PNG "animation" & loopindex & ".png"

    That will save all of the frames to PNGs automatically. Reimport to construct using the import frames feature so you can import them all at once, then open the animation to edit it, alt-click with the hotspot tool to set the hotspot for all the animation frames at once and alt-click crop to crop all the frames at once. Much faster.

    While trying to get it right, you might even be able to load all the frames from disk at runtime as well, by for 1 to 150, setting the animation frame of the sprite then loading animation frame from file "animation" & loopindex & ".png", though construct sometimes crashes when using this feature. Also, you need to make sure that a sprite has the number of frames you'd need before trying this at runtime, because you can't create animation frames at runtime.

  • [quote:3lcgkjqi]But the issue that remains is, in Construct you're able to set the animation speeds separately for each frame and each character, and set it to buttons so you see the movement progressions... it gives us a 100% accurate test since it's in the game. You can't do that in GIMP, so even if you preview each frame in GIMP, it won't be 100% the same in Construct when/if you make mods to the animation frames in Construct.

    I'd suggest you export the image to gif. You can have two of the same image open, then save one as a gif, and preview it in your favorite image viewer. When its exported Gimp will automatically set the frame rate for you, you can then change the frame speed for each frame by double clicking the layer in the layers window.

    Note:

    You wont be able to use the gif, but this method will at least let you figure out your speeds.

  • ^^^ In response to the previous two ideas, there seems to always be a way to make something work in this program, it's very versatile. But personally, I would rather something like this be made an option in the image editor rather than using events to get the result. You should be able to highlight all of your frames in the image editor and then select what command you want to apply to those frames, click the command, and then done.

    Importing images in a batch in Construct is as simple as clicking 'import frames' and then highlighting all the frames you want, then clicking 'open'. It should be just that simple to batch export, resize, and crop, as well. We're already 50% of the way there since the importing function already allows for batch commands.

  • It should be just that simple to batch export, resize, and crop, as well.

    As I mentioned, holding alt and clicking crop will crop all of the frames in an animation.

  • As I mentioned, holding alt and clicking crop will crop all of the frames in an animation.

    Yes, I know.

    The point is that all of it (including batch resize and batch export) should just be a selectable option in the image editor without work-arounds or using events. It should be as simple and readily available as the batch import functions are.

  • This really is image manipulation rather than game making, so seeing how the devs tend to take a minimalist approach (which they should) I doubt you would see something like this even in Construct 2. Plus there are literally hundreds of ways to do this, not to mention what can be done with Python.

  • I do these tasks either with Photoshops Batching or IrfanView. Both do a fine job.

  • Guys, c'mon! This is THEE most important need in all of Construct!

    Now, after I finish this second case of beer I'll tell you more...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)