T
T
TheR2013-01-27 21:58:38
Image processing
TheR, 2013-01-27 21:58:38

How / what is the easiest way to edit several hundred images in the same way?

Given : 500 PNG images of the same size (say, 100x100px), peacefully lying in the same folder on the local hard drive.
It is necessary No. 1 : from each of the available images, take a rectangular area of ​​​​a given size and position (say, with coordinates [10; 10] - [20; 20] relative to the image itself) and throw it into a separate PNG file. Well, that is, as a result, another 500 files will appear in the folder, say 001.png, 002.png, 003.png - or with names somehow derived from the original ones, it doesn’t matter.
It is necessary No. 2 : in each of the available images, fill in a fixed rectangular area (say, the same one with coordinates [10; 10] - [20; 20] relative to the image itself) with white color, and save the resulting image instead of the original one. That is, to a file with the same name.
Question : What is the most convenient and easiest way to do this, given that the task is one-time, that is, it will not need to be repeated anymore (which should exclude the option “write powerful specialized software that will be cool to do should be No. 1 and No. 2”)? Software ready to use (if so, which one)? Write a script? Many, many hard-working Indians, armed with Paint, please also do not offer.
Thank you!

Answer the question

In order to leave comments, you need to log in

12 answer(s)
A
AxisPod, 2013-01-28
@TheR

xnview does it with a bang, just draw the white picture you want and batch process it.

I
Ilya Klimov, 2013-01-27
@xanf

I would solve this with imagemagick.
convert test.png -crop 10x10+10+10 -repage 10x10 test2.png
(unfortunately now there is nowhere to test) - more details htrd.su/wiki/zhurnal/2012/02/16/imagemagick_vyrezanie_proizvolnoj_oblasti_ozobrazhenija The
second point is more difficult, you need something like -flatten, but here you need to play around, let the experts tell you

W
WEBIVAN, 2013-01-27
@WEBIVAN

In the same Photoshop create an automated task

J
Jonh Doe, 2013-01-27
@CodeByZen

For the first option, irfanView has a batch. You can do it there.

S
Sergey Lerg, 2013-01-27
@Lerg

I would write a python script using the python imaging library.

F
Figurnov, 2013-01-28
@Figurnov

If Photoshop is installed, make an Action in it and set it on files from the folder. This is the easiest and most convenient option. Spend 30-60 seconds creating an Action and a few minutes waiting to be applied to your files.
If photoshop is not worth it, download Imagemagick, figure out the options and make batch files (two pieces) perform the necessary actions on your files. Imagemagick can cut out fragments, draw rectangles, and a thousand other actions.

R
Ruslan, 2013-01-28
@hands

In Photoshop, this can be done using actions. Query on google .

K
KEKSOV, 2013-01-28
@KEKSOV

IrfanView both tasks can be implemented: Press the
letter B (atch), add all the necessary files For step
1, set up CROP

Z
ZloiZmei, 2013-01-28
@ZloiZmei

1) FastStine Image Viewer - Tools - Batch conversion - Change settings - Advanced settings - Crop - Specify XY coordinates.
It is easier to find other settings there
2) The second task can be solved in the same place using the watermark function

I
Ichi Nya, 2013-01-30
@Ichi

Photoshop can do (via macros). ACDSee through batch operations.

G
GoooodMan, 2013-02-01
@GoooodMan

You can also write a Matlab script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question