Automated chop up of PNG file
November 11, 2023 3:42 PM Subscribe
I have several PNG files, each with 50 or so small drawings separated by transparent space. I need to split the small drawings into their own files. Right now using Pixelmator I'm selecting each one by hand, cut and pasting them into their own layer, and then mass exporting the layers. There has to be a lazier way. Anyone? [slightly noisy sample file]
Best answer: This web tool might help. Load an image, and it detects the separate drawings. Click on a drawing, click "Export," and it downloads/saves an image. You can name each one separately in the interface, or just rely on your browser's download-overwriting-avoidance to automatically name each file differently. You still have to click for each separate drawing, but it's probably faster.
There are certainly automatic tools for this out there. Multiple images packed into one image file are used all the time in videogames, where they're called spritesheets. The tool you want would be called a "Spritesheet cutter" or "sprite extractor" or similar.
[As an alternative, this tool will auto-detect the drawings and let you export the coordinates of each. Then you'd need another tool to extract the images, though — or even an ImageMagick script that ChatGPT could possibly write.]
posted by whatnotever at 10:48 PM on November 11, 2023
There are certainly automatic tools for this out there. Multiple images packed into one image file are used all the time in videogames, where they're called spritesheets. The tool you want would be called a "Spritesheet cutter" or "sprite extractor" or similar.
[As an alternative, this tool will auto-detect the drawings and let you export the coordinates of each. Then you'd need another tool to extract the images, though — or even an ImageMagick script that ChatGPT could possibly write.]
posted by whatnotever at 10:48 PM on November 11, 2023
I’ve actually had very good success with getting ChatGPT to write ImageMagick scripts for me, including splitting a large PNG file into lots of smaller files with sensible names. So +1 to that strategy.
posted by graphweaver at 11:28 PM on November 12, 2023
posted by graphweaver at 11:28 PM on November 12, 2023
This thread is closed to new comments.
posted by falsedmitri at 4:31 PM on November 11, 2023