<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
  <channel>
    <title>#imagemagick posts — Ben Crowder</title>
    <link>https://bencrowder.net/blog/tag/imagemagick/</link>
    <atom:link href="https://bencrowder.net/blog/tag/imagemagick/feed/" rel="self" />
    <description>Feed for blog posts tagged with #imagemagick.</description>
    <lastBuildDate>Sat, 04 Apr 2026 05:22:16 GMT</lastBuildDate>
    <language>en-US</language>
    <generator>https://bencrowder.net/</generator>

    <item>
      <title>I’ve occasionally used ImageMagick’s erode and dilate filters to make art look a little less digital...</title>
      <link>https://bencrowder.net/blog/2023/1517/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2023/1517/</guid>
      <pubDate>Sat, 20 May 2023 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>I’ve occasionally used ImageMagick’s erode and dilate filters to make art look a little less digital. Turns out those filters are also available in Photoshop and Affinity Photo, just under different names: minimum blur and maximum blur. I had no idea. (I should mention that there might still be subtle differences between the algorithms. I didn’t do a deep dive. But from my limited testing they seem to do the same thing.)</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20I’ve occasionally used ImageMagick’s erode and dilate filters to make art look a little less digital...">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Another scripture poster, this time in English, French, German, Italian, Portuguese, and Spanish: Go...</title>
      <link>https://bencrowder.net/blog/2023/1445/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2023/1445/</guid>
      <pubDate>Sun, 29 Jan 2023 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>Another <a href="https://bencrowder.net/scripture-posters/#">scripture poster</a>, this time in English, French, German, Italian, Portuguese, and Spanish:</p>
<p><a href="https://bencrowder.net/scripture-posters/#go-with-him-twain">Go with him twain</a> (Matthew 5:41)</p>
<p><figure>
        <a href="https://bencrowder.net/scripture-posters/#go-with-him-twain"><img src="https://cdn.bencrowder.net/blog/2023/01/go-with-him-twain.jpg" alt="Go with him twain" title="Go with him twain" /></a>
        
      </figure></p>
<p>How I made these:</p>
<ul>
<li>Make a 4000&times;5000px background texture in Affinity Photo (lots of layers and blending modes) and save to <code>go-with-him-twain-bg.png</code></li>
<li>Lay out the text in Figma (900&times;1125px frame, bold Asap font at 126px, 150px line height, 6% letter spacing, white text on black background).</li>
<li>Export the frame as an SVG, <code>go-with-him-twain.svg</code></li>
<li>Add the following to the beginning of the SVG file (after the opening tag) and change the seed values:</li>
</ul>
<pre>
&lt;filter id="filter"&gt;
  &lt;feTurbulence seed="4389" type="turbulence" baseFrequency="0.5" numOctaves="2" result="turbulence2"/&gt;
  &lt;feDisplacementMap in2="turbulence2" in="SourceGraphic" scale="2" xChannelSelector="R" yChannelSelector="G" result="disp"/&gt;

  &lt;feTurbulence seed="4378" type="turbulence" baseFrequency="0.05" numOctaves="2" result="turbulence" /&gt;
  &lt;feDisplacementMap in2="turbulence" in="disp" scale="3" xChannelSelector="R" yChannelSelector="G" /&gt;
&lt;/filter&gt;

&lt;style type="text/css"&gt;
  path { filter: url(#filter); }
&lt;/style&gt;
</pre>
<ul>
<li>Convert the SVG to a 4000&times;5000px PNG: <code>/Applications/Inkscape.app/Contents/MacOS/inkscape go-with-him-twain.svg --export-type=png --export-width=4000</code></li>
<li>Erode/dilate: <code>convert go-with-him-twain.png -morphology erode disk:12 -morphology dilate disk:15 go-with-him-twain-eroded.png</code></li>
<li>Composite: <code>convert go-with-him-twain-bg.png \( go-with-him-twain-eroded.png -normalize +level 0,55% \) -compose screen -composite go-with-him-twain-composite.png</code> (I usually do this in Affinity Photo but I wanted to try using Imagemagick)</li>
<li>Upscale to 8000&times;10000px with Real-ESRGAN: <code>./realesrgan-ncnn-vulkan -i go-with-him-twain-composite.png -o go-with-him-twain-full.png -s 2</code></li>
<li>Add noise (8% monochromatic) in Affinity Photo and export final PNG (I could do this in Imagemagick, need to port it over)</li>
</ul><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Another scripture poster, this time in English, French, German, Italian, Portuguese, and Spanish: Go...">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>New abstract hymn print: Be Still, My Soul. I’m experimenting with a slightly new style here, maskin...</title>
      <link>https://bencrowder.net/blog/2023/1443/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2023/1443/</guid>
      <pubDate>Sat, 28 Jan 2023 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>New abstract hymn print: <a href="https://bencrowder.net/hymn-prints/#be-still-my-soul-abstract">Be Still, My Soul</a>.</p>
<p>I’m experimenting with a slightly new style here, masking the notes (after adding noise to the outlines with SVG filters and then eroding/dilating with Imagemagick) and painting inside the mask in Procreate. (And then texturing it in Affinity Photo as usual.)</p>
<p><figure>
        <a href="https://bencrowder.net/hymn-prints/#be-still-my-soul-abstract"><img src="https://cdn.bencrowder.net/images/design/hymn-prints/be-still-my-soul-abstract.jpg" alt="Be Still, My Soul" title="Be Still, My Soul" /></a>
        
      </figure></p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20New abstract hymn print: Be Still, My Soul. I’m experimenting with a slightly new style here, maskin...">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Hymn prints</title>
      <link>https://bencrowder.net/blog/2023/hymn-prints/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2023/hymn-prints/</guid>
      <pubDate>Sun, 08 Jan 2023 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>A new experimental nerdy thing, for people who like hymns, sheet music, and textures:</p>
<p><figure>
        <a href="https://bencrowder.net/hymn-prints/#abide-with-me"><img src="https://cdn.bencrowder.net/images/design/hymn-prints/abide-with-me.jpg" alt="The first few measures of “Abide with Me!”" title="The first few measures of “Abide with Me!”" /></a>
        
      </figure></p>
<p><figure>
        <a href="https://bencrowder.net/hymn-prints/#the-spirit-of-god"><img src="https://cdn.bencrowder.net/images/design/hymn-prints/the-spirit-of-god.jpg" alt="The first few measures of “The Spirit of God”" title="The first few measures of “The Spirit of God”" /></a>
        
      </figure></p>
<p>How I make these <a href="https://bencrowder.net/hymn-prints/">hymn prints</a> (as I’m calling them):</p>
<ul>
<li>Typeset the first phrase (or so) in MuseScore using the Bravura font, with the spacing trimmed to within an inch of its life</li>
<li>Play it out loud to make sure I entered it right (cough) and export an SVG</li>
<li>Drag the SVG into a frame in Figma and use the SkewDat plugin to skew it -4°, center it, then export a 4,000px-wide PNG</li>
<li>Use ImageMagick to do some erosion and dilation (to simulate age and ink spread): <code>convert input.png -morphology erode disk:18 -morphology dilate disk:16 output.png</code></li>
<li>Texture the image in Affinity Photo and export the PNG</li>
<li>Upscale with Real-ESRGAN to 12,000px-wide</li>
<li>Downscale a little in Affinity Photo, add 8% monochrome noise, and export the final PNG</li>
</ul>
<p>I’m still figuring out how I want to do these (full bleed or not, barlines, clefs and key signatures or not, etc.). Also thinking about possibly doing some abstract versions as well, to avoid all these music typesetting issues entirely.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Hymn prints">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Scanning journals</title>
      <link>https://bencrowder.net/blog/2015/scanning-journals/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2015/scanning-journals/</guid>
      <pubDate>Wed, 16 Dec 2015 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>I’ve recently begun scanning my journals using my iPhone and the Scanner Pro app, and it’s working out fairly well. My process:</p>
<ul>
<li>Using the built-in iPhone camera app, I long press to lock focus and exposure (this saves time so it doesn’t have to autofocus each time), then photograph each page of the journal. It’s not as high quality as it would be if I used an actual scanner, but it’s much, much faster, and far more portable.</li>
<li>After I’m done photographing, I open Scanner Pro and select the images from the camera roll, then use the Black &amp; White Document setting to process them into a PDF.</li>
<li>From Scanner Pro, I export the PDF to Dropbox.</li>
</ul>
<p>The resulting PDF is nice and clean and easy to read, and the files aren’t too big (150 pages is usually between 80 and 200 megs — for me, very much worth the space to preserve important documents).</p>
<p>A concocted example:</p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2015/12/input.jpg" alt="input.jpg" title="input.jpg" />
        
      </figure></p>
<p>That’s before (the image is straight from my iPhone camera, no postprocessing), and this is after Scanner Pro is done with it:</p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2015/12/scanner-pro.jpg" alt="scanner-pro.jpg" title="scanner-pro.jpg" />
        
      </figure></p>
<p>I should add that ordinarily, with actual journals there wouldn’t be as much empty border around the content.</p>
<p>One hitch I’ve run into is that Scanner Pro chokes on anything larger than around 150 pages (it crashes), so I do long journals in chunks.</p>
<p>For that reason and a few other small annoyances, I’ve been looking into replacing Scanner Pro with a desktop-based script that takes a list of photos and processes them into a nice black and white PDF. Imagemagick gets me part of the way there with this command:</p>
<pre><code>convert input.jpg -threshold 50% -blur 1x1 output.jpg
</code></pre>
<p>Here’s what it looks like for the above note card scan, at 30%, 50%, and 70% threshold, respectively:</p>
<p><figure class="border">
        <a href="http://cdn.bencrowder.net/blog/2015/12/imagemagick.jpg"><img src="https://cdn.bencrowder.net/blog/2015/12/imagemagick.jpg" alt="imagemagick.jpg" title="imagemagick.jpg" /></a>
        
      </figure></p>
<p>At some point I’ll try writing a Python script that dynamically evaluates each page and adjusts the threshold as necessary to get the best result. Until then, though, I’m still using Scanner Pro.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Scanning journals">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Asteroids</title>
      <link>https://bencrowder.net/blog/2015/asteroids/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2015/asteroids/</guid>
      <pubDate>Fri, 09 Oct 2015 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>Earlier this week I wrote a small Asteroids clone in JavaScript:</p>
<figure><a href="https://bencrowder.net/coding/asteroids/"><img src="https://cdn.bencrowder.net/images/projects/asteroids/asteroids.gif" alt="Video of the game" /></a></figure>
<p>Instructions and the link to the game are on the <a href="https://bencrowder.net/coding/asteroids/">project page</a>.</p>
<p>FYI, here’s how I made the animated GIF: I used Quicktime Player to record a portion of the screen, then used ImageMagick to convert the .mov file to a series of PNGs:</p>
<pre><code>convert asteroids.mov png/asteroids_%03d.png
</code></pre>
<p>I deleted the extra frames at beginning and end that I didn’t care about (unpausing the game, figuring out how to turn the recording off), then used ImageMagick again to make the GIF:</p>
<pre><code>convert -delay 1x30 png/*.png -layers optimize +dither -colors 32 asteroids.gif
</code></pre><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Asteroids">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Some small scripts</title>
      <link>https://bencrowder.net/blog/2013/some-small-scripts/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2013/some-small-scripts/</guid>
      <pubDate>Tue, 05 Mar 2013 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>Migrating to Day One has resurrected my efforts to scan and transcribe my older paper journals. As I’ve been doing this, I’ve run into the need for a couple small <a href="https://bencrowder.net/coding/scripts/">shell scripts</a> to automate things.</p>
<p>On several of these journals I’m scanning the full two-page spread because the whole journal fits on the scanner platen, which means splitting the resulting image out into two (one for each page). <a href="https://gist.github.com/bencrowder/5091137">Splitimage</a> uses ImageMagick to do that nicely. There’s some overlap, but for a fully automated solution it’s not bad, and it saves me a lot of time cropping.</p>
<p>I prefer taking these split images and renaming them sequentially using something more meaningful (“journal-2009.005.jpg” rather than “IMG_0034.JPG”, for example). I used to do this with OS X’s Automator tool, and it works quite well, but I wanted a quick command-line tool to speed things up. Enter <a href="https://gist.github.com/bencrowder/5091048">dub</a>, a zsh script that simplifies the batch renaming process. Now I can just type:</p>
<pre><code>dub journal-2009.X.jpg *.JPG
</code></pre>
<p>And then it’s just a matter of dumping them into Unbindery and transcribing them.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Some small scripts">Reply via email</a></p>]]></description>
    </item>
    
  </channel>
</rss>
