TechSpot

Batch operation on image files

By kritonas
Apr 11, 2008
  1. Hello all,

    I've got a bunch of 128x128 png files and I would like to create a 1-2 pixels wide stroke around each one of them (as a frame). The size should remain the same, the stroke should overwrite what's already there.

    It's for business so it doesn't really matter if the program is not free.
     
  2. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    ImageMagick comes with a pile of command-line image manipulation tools. You want to run something like "convert -stroke blue -strokewidth 2 -fill none -draw 'rectangle 1,1 127,127' input.png output.png" This would draw a 2px wide blue border around input.png and save to output.png
     
  3. kritonas

    kritonas TS Rookie Topic Starter Posts: 49

    thank you nodsu.
    I've tried running the line you said, and I got some errors:

    C:\>convert -stroke blue -strokewidth 2 -fill none -draw 'rectangle 1,1 127,127'
    cheque.png cheque2.png
    convert: unable to open image `1,1': No such file or directory.
    convert: unable to open image `127,127'': No such file or directory.
    convert: Non-conforming drawing primitive definition `rectangle'.

    I checked the -draw syntax with their manual, it seems ok. any ideas?
     
  4. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    It looks like it can't recognise the single quotes around the rectangle definition and tries to interpret the coordinates as filenames. Maybe try with double quotes?

    I posted the command that works in unix, but the Windows versions of many programs have glitches and features that are not documented.
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...