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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More