Liquid-rescale covers using ImageMagick

Generic Customer Feedback, Content and Reviews based directly on PSIO
Post Reply
User avatar
NRGDEAD
Lives in the Cybdyn Systems Server
Lives in the Cybdyn Systems Server
Posts: 166
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Liquid-rescale covers using ImageMagick

Post by NRGDEAD » October 2nd, 2018, 7:50 am

Since 80x84's aspect ratio of 20x21 isn't exactly like the common PlayStation covers, and I dislike distorted images, but don't want to edit hundreds of covers in Photoshop either, I experiemented a bit with ImageMagick. For those who don't know what that is, it's basically Photoshop for the command line. It's especially great for batch processing. It's available for Linux, Mac and likely Windows.
I came up with this:

Code: Select all

mogrify -normalize -scale 240x252^ -liquid-rescale 240x252\! -scale 80x84 -format bmp *.*
The parameters are applied to the images as listed, so this will:
Normalize the image: optimal contrast is applied. This fixes most bad scans with too much brightness, where black is gray and white is gray, too.
Scale it down to fill an area (^) of 240x252, maintaining the current aspect ratio of the image. Image will likely still be larger.
Liquid-Scale it down to exactly (!, masked as \! for your terminal copy/pasting convenience) 240x252, ignoring the old aspect ratio and making it 20x21. This is the cool part: using seam carving, ImageMagick removes not a line of pixels but a seam, thus it mostly looks like one moved parts of the image to fit closer together.

So, assuming the source images are somewhat square and not too rectangular - and/or have many parts with little detail, you should get fairly decent results. And while this is still distorted in a way, it's a lot less obvious and looks really good on most covers I tried it with so far.

Side note for ImageMagick cracks: yeah, the 240x252 step isn't ideal, but ImageMagick seemingly can't change just the aspect ratio based on the current resolution. That would require scripting. However, this still a lot better than directly (liquid-)scaling to 80x84 because it becomes messy quickly that way. Feel free to correct me, though; I'd love for this to work more elegant and precise.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest