J
J
Jonh Doe2013-07-03 23:21:39
Images
Jonh Doe, 2013-07-03 23:21:39

Scaling and cropping images to given dimensions?

In the Apple Store, movie posters have the same width and height. Accordingly, everything looks good. But finding the same posters is not so easy. They differ in size, especially in older films.
The question is. Do they adjust each poster with pens so as not to cut anything necessary, or is there some kind of algorithm?
36d954ed9ebe75f3d155d6732798c186.png
Thank you in advance for the links to the material, algorithms and comments.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
StepanTomsk, 2013-07-04
@StepanTomsk

There is an Open Source image-processing library rich in ImageMagick , among others it has a console program convert , which allows you to perform a huge number of transformations with images (there are examples on the Internet how to use it to repeat Photoshop effects).
For batch processing, you can write a script (for example, in bash) that scans all files in a folder, and then performs actions for each through convert.
Here is a nice page with convert -resize examples .
An example of converting the original image to a size of 500x500 px:

convert in.jpg -resize 500x500\! out.jpg

P. _ S .: Runs on Linux, Windows, Mac Os X, iOS, Android OS, FreeBSD and a number of other compatible platforms.

X
xmoonlight, 2013-07-04
@xmoonlight

There is such a thing phpThumb
Here is an example of a site with it: example

D
Dmitry, 2013-07-04
@webmix

And there is also software that batch processes images (cropping, size, proportions, conversion, etc.) - for example, FSResizer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question