DEV Community

Ko Takagi
Ko Takagi

Posted on

5 1

Using Imagemagick to easily split an image file

convert command of ImageMagick is very useful to split an images file.

To use the convert, you'll need to install ImageMagick beforehand.

brew install imagemagick
Enter fullscreen mode Exit fullscreen mode

Split the image to the left and right

input.png

Alt Text

convert -crop 50%x100% input.png output.png
Enter fullscreen mode Exit fullscreen mode

output-0.png

Alt Text

output-1.png

Alt Text

Split the image to the top and bottom

input.png

Alt Text

convert -crop 100%x50% input.png output.png
Enter fullscreen mode Exit fullscreen mode

output-0.png

Alt Text

output-1.png

Alt Text

Split the image into 4 parts

input.png

Alt Text

convert -crop 50%x50% input.png output.png
Enter fullscreen mode Exit fullscreen mode

output-0.png

Alt Text

output-1.png

Alt Text

output-2.png

Alt Text

output-3.png

Alt Text

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more