Brett Klamer

Tips for Editing Product Images


Gordon Food Service has a nice guide for packaged and raw products.

Create Outlined Image in Gimp

If you don’t have proper lighting and backgrounds, it might be best to use an outline image with transparent background.

  1. Open in Gimp
    1. Layer
      1. Transparency
        1. Add Alpha Channel
    2. Scissor Tool
      1. Check Antialiasing
      2. Check Feather edges (8)
      3. Check Interactive Boundary
      4. Zoom in on Image
      5. Start clicking boundary points
      6. Click on the starting boundary point when done
      7. Click in center of scissor area to select it
    3. Click the Select Button
      1. Invert
      2. Click the Keyboard Delete Button to delete the background.
    4. Image button
      1. Autocrop Image
    5. Save a .xcf file for future editing
    6. Export a .png file for use.

Rotating Images in Gimp

  1. Tools Button
    1. Transform Tools
      1. Rotate

Trim or Autocrop Alpha Channel with ImageMagick

This automatically crops images from a transparent alpha channel background.

mogrify -trim +repage *.png

Resize Edited Photos With ImageMagick

Simple resizing.

mogrify -resize WxH *.png

To create images with the same canvas size. (useful for thumbnails or other such needs.)

mogrify -gravity center -background transparent -extent WxH *.png

Reduce File Size using PNGCrush

for file in *.png ; do pngcrush -brute "$file" "${file%.png}-crushed.png" && mv "${file%.png}-crushed.png" "$file" ; done

Delete Files with Name Containing “foo”

# try without -delete to see what it will apply to.
find -type f -name '*foo*' -delete

Rename Files by Appending “foo” to End

for file in *.png; do mv $file "${file%.png}-foo.png"; done

Rename Files by Removing “foo”

# "-f" to force rename files in current directory
rename -f 's/foo//' *.png

Rename Files Based on csv File

Will rename all files in folder from the first files.csv column name to the second files.csv column name. Useful when combined with the duplication script below. Based on

sed 's/"//g' files.csv | while IFS=, read orig new; do mv "$orig" "$new"; done

Duplicate a File N Times

This will duplicate foo.png N times and name the files sequentially: foo-001.png, foo-002.png, … foo-N.png.

for n in {001..N}; do cp foo.png foo-$n.png; done
Published: 2015-04-15