<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/image-editing">
  <channel>
    <title>Image Editing</title>
    <link>https://www.linuxjournal.com/tag/image-editing</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>GIMP, More Awesome Than I Remember</title>
  <link>https://www.linuxjournal.com/content/gimp-more-awesome-i-remember</link>
  <description>  &lt;div data-history-node-id="1339529" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/12188fossf1.jpg" width="600" height="502" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/shawn-powers" lang="" about="https://www.linuxjournal.com/users/shawn-powers" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Shawn Powers&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
For what seems like decades, GIMP (Graphic Image Manipulation Program)
has been the de facto standard image editor for Linux. It works well,
has many features, and it even supports scripting. I always have found
it a bit clumsy, however, and I preferred using something else for day-to-day
work. I recently had the pleasure of sitting at a computer without an
image editor though, so I figured I'd give GIMP another try on a non-Linux
operating system. See, the last time I tried to use GIMP on OS X, it
required non-standard libraries and home-brew adding. Now, if you head
over to &lt;a href="https://gimp.org"&gt;the GIMP site&lt;/a&gt;, you can download a fully native version of
GIMP for Windows, OS X and Linux.
&lt;/p&gt;

&lt;p&gt;
I'll be honest, just being able to install GIMP with a simple drag and
drop on OS X was an improvement worth noting. When I actually started using
it, however, I found that it's truly as powerful as Photoshop for the
things I do. Granted, Photoshop likely has features advanced users might
need that GIMP doesn't have, but everything I do with images was fully
supported without exception. In the screenshot (from an OS X machine),
you can see an example of me "painting" my Volkswagen using nothing
more than the auto-selection tool and a virtual airbrush.
&lt;/p&gt;
&lt;img src="http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12188fossf1.jpg" alt="" title="" class="imagecache-large-550px-centered" /&gt;&lt;p&gt;
If you're looking for a great graphic editor and want to be consistent
across platforms, GIMP is truly hard to beat. And if you tried it years
ago but didn't really care for it, I urge you to give it another try. I'm
shocked at how well it works, even on platforms other than Linux!
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/gimp-more-awesome-i-remember" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Mon, 23 Oct 2017 11:24:19 +0000</pubDate>
    <dc:creator>Shawn Powers</dc:creator>
    <guid isPermaLink="false">1339529 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Watermarking Images--from the Command Line</title>
  <link>https://www.linuxjournal.com/content/watermarking-images-command-line</link>
  <description>  &lt;div data-history-node-id="1339490" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/bash-148836_960_720_5.png" width="400" height="316" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/dave-taylor" lang="" about="https://www.linuxjournal.com/users/dave-taylor" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Dave Taylor&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
Us geeks mostly think of the command line as the best place for text
manipulation. It's a natural with &lt;code&gt;cat&lt;/code&gt;,
&lt;code&gt;grep&lt;/code&gt; and shell scripts. But
although you can't necessarily view your results from within a typical
terminal window, it turns out to be pretty darn easy to analyze and
manipulate images from within a shell script.
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.linuxjournal.com/content/manipulate-images-imagemagick"&gt;In my 
last article&lt;/a&gt;, I introduced the splendid open-source ImageMagick suite that
offers more features and functionality than you can shake a tree's
worth of branches at. Why you would be shaking a tree at a piece of
software escapes me, but, hey, I'm just writing this stuff, not
thinking about what I'm saying.
&lt;/p&gt;

&lt;p&gt;
Um...wait a sec.
&lt;/p&gt;

&lt;p&gt;
Anyway, ImageMagick includes a variety of programs that let you analyze,
manipulate and even convert image files in a remarkable number of different
ways.
&lt;/p&gt;

&lt;p&gt;
My last article described setting things up and a few easy ways to
confirm that the suite was working correctly on your computer. Now let's
start with a simple task that can be useful for web servers: a
script that checks image files and flags any that are more than a specific
size.
&lt;/p&gt;

&lt;p&gt;
In fact, let's use 8MB because that's the maximum size allowed in
Facebook Open Graph, a fact of which many webmasters are already well
aware.
&lt;/p&gt;

&lt;h3&gt;
Finding Those Big Darn Image Files&lt;/h3&gt;

&lt;p&gt;
Identifying big files can be done with a simple
&lt;code&gt;find&lt;/code&gt;, but the goal here is to do
something more sophisticated, so let's pair it with the
ImageMagick command &lt;code&gt;identify&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
Here's a loop to identify files bigger than a specified size:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
for name in `find *{png,jpg} -size +8M -print`
do
    echo file $name is bigger than 8MB
done
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
That's a good start, but for those image files that match, more detail
would be helpful, and I'm not talking &lt;code&gt;ls -l&lt;/code&gt; output!
Instead, let's
replace the rudimentary &lt;code&gt;echo&lt;/code&gt; statement with something more
advanced:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
dimensions=$(identify $name | cut -d\  -f3)
size=$(identify $name | cut -d\  -f7)
echo "File $name ($dimensions) has file size $size"
&lt;/code&gt;
&lt;/pre&gt;



&lt;p&gt;
Now let's have a quick test:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
$ sh bigimages.sh
File screenshot-6.png (1800x490) has file size 9.639MB
$
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
It's definitely more informative than just doing an &lt;code&gt;ls -l&lt;/code&gt; and particularly so if you
were to put this in an automatic email report for hosting
clients!
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;Why? Because lots of people who aren't tech-savvy upload images
directly from digital cameras—images that can be enormous. They resize the
displayed image in their blog posts, but the original files are way larger
than necessary, slowing down their sites unnecessarily.&lt;/em&gt;
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/watermarking-images-command-line" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Tue, 12 Sep 2017 13:52:13 +0000</pubDate>
    <dc:creator>Dave Taylor</dc:creator>
    <guid isPermaLink="false">1339490 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Manipulate Images with ImageMagick</title>
  <link>https://www.linuxjournal.com/content/manipulate-images-imagemagick</link>
  <description>  &lt;div data-history-node-id="1339466" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/Terminalicon2_0.png" width="500" height="500" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/dave-taylor" lang="" about="https://www.linuxjournal.com/users/dave-taylor" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Dave Taylor&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
In my &lt;a href="http://www.linuxjournal.com/content/scissors-paper-or-rock"&gt;last
article&lt;/a&gt;, I had some fun looking at the children's game of rock,
paper, scissors, writing a simple simulator and finding out that some
strategies are better than others. Yes, I used "strategy" and
"rock, paper, scissors" in the same sentence!
&lt;/p&gt;

&lt;p&gt;
So for this article, I thought it would be interesting to delve into something
more functional and pragmatic: image manipulation. Ordinary shell scripts
don't tend to do much with images because you can't display anything
from the command line.
&lt;/p&gt;

&lt;p&gt;
But let's be honest here. The chance that you're running Linux or
a similar command-line interface raw on a computer terminal is pretty
darn low. More likely, you've got a terminal window open on your X11
system or, like I often have, you're running a command-line interface
app within a modern OS like Mac OS X. And this means, yes, you do have the
ability to display graphics, just not within the terminal app itself.
&lt;/p&gt;

&lt;h3&gt;
Get Yourself a Copy of ImageMagick&lt;/h3&gt;

&lt;p&gt;
The first step is to download and install a copy of the ImageMagick
suite of graphics-related commands. You already might have it installed
if you're lucky: Just type &lt;code&gt;convert -version&lt;/code&gt;, and if you have it
installed, you'll see something similar to this:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
$ convert -version
Version: ImageMagick 6.9.6-6 Q16 x86_64 2016-12-31
 ↪http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib
 ↪jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff
 ↪webp x xml zlib
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
If you don't have it installed, it can be quite a task to get it all
up and running. Everything lives &lt;a href="http://www.imagemagick.org"&gt;here&lt;/a&gt;, which is where
you want to get started.
&lt;/p&gt;

&lt;p&gt;
On a Linux system, you can use the package manager of choice for your
distro. You can grab a compressed tar image from the site, or you can
use &lt;code&gt;rpm&lt;/code&gt;, like this:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
rpm -Uvh ImageMagick-7.0.4-1.x86_64.rpm
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
Of course, there's a bit more to it, but that'll get you started.
&lt;/p&gt;

&lt;p&gt;
On a Mac, you'll want to start by installing &lt;a href="http://www.macports.org"&gt;MacPorts&lt;/a&gt;,
which you can't do until you install Xcode
(free from Apple, get it through the App Store). Once you've installed
Xcode and MacPorts, you can install ImageMagick, and you're good
to go.
&lt;/p&gt;

&lt;p&gt;
You know you're good to go when the test command &lt;code&gt;convert
-version&lt;/code&gt;
returns something meaningful. As always, when you install new software,
you'll want to log out and log in again for the PATH changes and shell
command-line hash to include all the newest programs.
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/manipulate-images-imagemagick" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 17 Aug 2017 12:05:50 +0000</pubDate>
    <dc:creator>Dave Taylor</dc:creator>
    <guid isPermaLink="false">1339466 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Resizing Images with ImageMagick</title>
  <link>https://www.linuxjournal.com/content/resizing-images-imagemagick</link>
  <description>  &lt;div data-history-node-id="1335710" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/logo%20%282%29_0.jpg" width="123" height="118" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/dave-taylor" lang="" about="https://www.linuxjournal.com/users/dave-taylor" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Dave Taylor&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
Sure, you can open up a graphics program like GIMP and resize an image, but
what if you want to resize 10, 50 or 200 images?
ImageMagick's &lt;code&gt;convert&lt;/code&gt; program is just what you need.
&lt;/p&gt;

&lt;p&gt;
I a previous article, I started a series on working with &lt;a href="http://www.linuxjournal.com/content/image-manipulation-imagemagick"&gt;ImageMagick on the
command line&lt;/a&gt;, but then I had to stop and deal with the massive migration project of moving my
AskDaveTaylor.com site from one server to another while simultaneously
dropping it into a completely different back-end software system—madness.
I'm still fixing things and cleaning up the insane sprawl of it
all.
&lt;/p&gt;

&lt;p&gt;
So, &lt;a href="http://www.linuxjournal.com/content/debugging-web-sites"&gt;my last article&lt;/a&gt; detoured into a discussion of scripts that helped
with the migration process. I'm still working on these fast, short
scripts, including one I wrote this morning:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
for entry in blog/*
do
  new=$(echo $entry | sed 's/blog\///')
  echo "Redirect 301 $entry $new"
done
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
Can you track what this loop does? The only tricky part is the
&lt;code&gt;new=&lt;/code&gt;statement that removes
&lt;code&gt;blog/&lt;/code&gt; from the filename
matched in the &lt;code&gt;for&lt;/code&gt; statement; otherwise, it's quite
straightforward.
&lt;/p&gt;

&lt;p&gt;
Seriously though, let's return to ImageMagick. There are 
a ton of things you can do with the command-line utilities.
But first, let me look at where I left off.
&lt;/p&gt;

&lt;p&gt;
I'd just shown a
simple example of ImageMagick command-line tools to identify the dimensions of
an image and use that as the basis of coming up with a scaled HTML img tag.
Here's the script:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
#!/bin/sh
identify=/usr/bin/identify
scale=$1
image=$2   # needs input validation code

height=$($identify $image | cut -d\   -f3 | cut -dx -f1)
width=$($identify $image | cut -d\   -f3 | cut -dx -f2)
newwidth="$(echo $width \* $scale | bc | cut -d. -f1)"
newheight="$(echo $height \* $scale | bc | cut -d. -f1)"
echo "&lt;img src=$image height=$newheight width=$newwidth&gt;"
exit 0
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
(Actually, I couldn't resist tweaking it slightly if you are 
keeping track, but I'm still being lazy and not validating the input as
of yet. You can add that code easily enough.)
&lt;/p&gt;

&lt;p&gt;
In use:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ scaledown.sh 0.5 pvp.jpg
&lt;img src=pvp.jpg height=152 width=485&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
Okay, that's one way to make the display of the image be reduced on a
Web page, but anyone who has done any work trying to speed up a Web site
knows the huge problem here: reducing the container that displays an image
doesn't reduce the image. The Web site visitor still has to download
the original image, which is a huge waste of bandwidth and a performance
hit.
&lt;/p&gt;

&lt;p&gt;
So let's update the script to create a new, smaller version of
the image as part of its output.
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/resizing-images-imagemagick" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 29 May 2014 19:55:01 +0000</pubDate>
    <dc:creator>Dave Taylor</dc:creator>
    <guid isPermaLink="false">1335710 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>GIMP Shmimp, Give Me a Browser</title>
  <link>https://www.linuxjournal.com/content/gimp-shmimp-give-me-browser</link>
  <description>  &lt;div data-history-node-id="1208488" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/11594pixf1.jpg" width="550" height="368" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/shawn-powers" lang="" about="https://www.linuxjournal.com/users/shawn-powers" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Shawn Powers&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
Don't get me wrong, I love The GIMP. We all love The GIMP, as our Readers'
Choice awards show this month. If I'm being completely honest, however, I
rarely have the need for such a powerful application. Usually, regardless
of what computer system I'm on, I pick Pixlr as my image editing program.
&lt;/p&gt;

&lt;img src="http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11594pixf1.jpg" alt="" title="" class="imagecache-large-550px-centered" /&gt;&lt;p&gt;
Pixlr is a Web-based image editing tool that rivals native applications
in speed, and more important, in functionality. Powerful tools like
"spot heal" that aren't found in most simple image editors are essential for
folks like me who still get teenager-like pimples in their late 30s. It
also integrates with on-line storage (Flickr, Picasa, Facebook) and allows
simple uploads/downloads to your local computer. In fact, you have to
look really hard in order to realize Pixlr isn't a native application.
&lt;/p&gt;

&lt;p&gt;
Regardless of what operating system you're on, you can check out Pixlr
right now by heading to &lt;a href="http://pixlr.com/editor"&gt;http://pixlr.com/editor&lt;/a&gt;. It's not GIMP, but
it certainly isn't gimpy either.
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/gimp-shmimp-give-me-browser" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Fri, 13 Dec 2013 17:48:59 +0000</pubDate>
    <dc:creator>Shawn Powers</dc:creator>
    <guid isPermaLink="false">1208488 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
