The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Category: Photography & Images

Taking & making images.

  • Generating Button Images With ImageMagick

    Starting with the hints and commands at ImageMagick Advanced Techniques for Gel Effects, I came up with a script that spits out colorful gel-flavored buttons:

    convert -size 120x64 xc:none -fill red -draw "roundrectangle 10,10 110,54 8,8" \
      gel_shape.png
    #display gel_shape.png
    convert gel_shape.png \
      \( +clone -alpha extract -blur 0x12 -shade 110x0 \
      -normalize -sigmoidal-contrast 16,60% -evaluate multiply .5\
      -roll +4+8 +clone -compose Screen -composite \) \
      -compose In  -composite \
      gel_highlight.png
    #display gel_highlight.png
    convert gel_highlight.png \
      \( +clone -alpha extract  -blur 0x2 -shade 0x90 -normalize \
      -blur 0x2  +level 60,100%  -alpha On \) \
      -compose Multiply -composite \
       gel_border.png
    #display gel_border.png
    convert gel_border.png \
      -font Verdana-Bold  -pointsize 20  -fill white  -stroke black \
      -gravity Center  -annotate 0 "Jelly"  -trim -repage 0x0+7+7 \
      \( +clone -background navy -shadow 80x4+4+4 \) +swap \
      -background snow4  -flatten \
      gel_button.png
    convert gel_button.png -type truecolor Gelly24.bmp
    display -resize 300% Gelly24.bmp
    

    I could not ever figure that stuff out on my own.

    For some reason, WordPress chokes when uploading the starting shape as a PNG file, so here it is as a JPG with a black border replacing the original transparency:

     

    gel_shape
    gel_shape

    With the gel highlight:

    gel_highlight
    gel_highlight

    Adding a border:

    gel_border
    gel_border

    Adding text, shadow, and background:

    gel_button
    gel_button

    Adding the drop shadow may increase the image size ever so slightly, so the -repage 0x0+7+7 operation may require resetting the exact image size.

    The final step converts the PNG image into the 24-bit uncompressed BMP format required by the Adafruit routine that slaps it into the TFT display:

    Adafruit TFT display - timing demo
    Adafruit TFT display – timing demo

    The smaller buttons came directly from The GIMP, with full-frontal manual control over everything. Obviously, that doesn’t scale well for many buttons that should all look pretty much the same, because you want to get your fingers out of the loop.

    But, obviously, when you do this on a mass scale, you want better control over the colors and text and suchlike; that’s in the nature of fine tuning when it’s needed.

    I’m not entirely convinced I want gel-flavored buttons, but it was a fun exercise.

  • Turtle Teleportation: Love Road

    We spotted another turtle while on a grocery ride:

    Turtle on Love Rd - as spotted - 2014-07-02
    Turtle on Love Rd – as spotted – 2014-07-02

    Although this is certainly meddling in the turtle’s affairs, it seemed reasonable on a torrid day with plenty of hot asphalt to cross:

    Turtle on Love Rd - pickup - 2014-07-02
    Turtle on Love Rd – pickup – 2014-07-02

    I made the (possibly unwarranted) assumption that the turtle wanted to cross the road; I’ve been wrong before.

    In any event, this must be what teleportation feels like:

    Turtle on Love Rd - delivery - 2014-07-02
    Turtle on Love Rd – delivery – 2014-07-02

    There’s not really much on that side of the road, other than an inactive oil spill site left over from when Love Oil ran a tank farm. That’s why it’s called Love Rd, of course.

    Perhaps someone else will help the turtle cross the road in the other direction…

     

     

  • Sony HDR-AS30V Camera: Protecting The Lens

    The 170° fisheye lens on the HDR-AS30V action camera protrudes from the front of the case, the better to view the passing scenery:

    Sony HDR-AS30V Action Camera
    Sony HDR-AS30V Action Camera

    Unfortunately, that means there’s nothing to protect it when the scenery gets a bit too close.

    Mounting it upside-down in the skeleton frame provides a bit of protection, by putting it inside the straight line connecting the helmet brim with the top of the frame:

    Sony HDR-AS30V camera on bike helmet - inverted
    Sony HDR-AS30V camera on bike helmet – inverted

    That won’t protect it from severe impacts, but perhaps a casual drop won’t scar the lens. You can tell from the scuffs that the helmet does get dropped every now and then.

    Most of the camera mounts on Thingiverse don’t take that into account, alas.

    When you remove the skeleton mount from the helmet, grip the camera between finger and thumb while releasing the latch with your other hand. The mount will dangle from your fingers and the camera won’t slide out; if you don’t have both hands free, don’t mess with the camera.

    Even though it doesn’t look at all like a GoPro Hero, everybody recognizes the “camera on helmet” meme and, in general, behaves a bit more circumspectly. I didn’t see that coming, not at all.

     

  • Monthly Image: Hudson River Boating

    Much of the boat traffic on the Hudson consists of barges shuttling bulk commodities between the Atlantic and the Port of Albany. I think this is a crude oil barge, based on the Christmas Tree plumbing that was more visible when it passed under the Mid Hudson Bridge:

    Walkway and Barge - from Mid Hudson Bridge
    Walkway and Barge – from Mid Hudson Bridge

    We crossed the Walkway Over the Hudson westbound, where a work crew was tending a crane. That’s how they do repair and inspection:

    Walkway Inspection Crane - from Mid Hudson Bridge
    Walkway Inspection Crane – from Mid Hudson Bridge

    The Hudson River has far fewer power boats than in years gone by, probably due to their gallon-per-minute fuel consumption:

    Power boat on Hudson River - from Mid Hudson Bridge
    Power boat on Hudson River – from Mid Hudson Bridge

    It was a fine day for a ride:

    KE4ZNU - APRS track 2014-06-30
    KE4ZNU – APRS track 2014-06-30
  • Tweaked Crossword Scanning

    In what’s surely a change intended to better meet the needs of their customers, the newspaper changed the crossword layout just a little teeny bit, so my previous script needed a tweak:

    #!/bin/bash
    echo Scanning...
    scanimage --mode Gray --opt_emulategray=yes --resolution 300 -l 5 -t 0 -x 105 -y 195 --format=pnm > /tmp/scan.pnm
    echo Converting...
    convert /tmp/scan.pnm -level 45%,60% -resize 2400x3150 +repage -unsharp 0 /tmp/trim.png
    convert -density 300 -size 2550x3300 canvas:white /tmp/trim.png -gravity center -composite /tmp/page.pdf
    echo Printing...
    lp -n 2 /tmp/page.pdf
    echo Done!
    

    It now spits out two large-print copies, to better meet their actual needs, at least for two of their customers.

  • A Pleasant Ride, With Turtle

    It was not, however, a pleasant turtle:

    Snapping Turtle on DCRT - 2014-06-04
    Snapping Turtle on DCRT – 2014-06-04

    That’s a fairly large snapping turtle in the middle of the Dutchess Rail Trail, between Morgan Lake and the Violet Avenue tunnel.

    Snappers can move just under the speed of light for about a foot in order to latch onto you, but they’re not quite as fast while turning around: always pass to their rear. You do not attempt to save them from their folly at being in the middle of the road / trail / driveway: they have absolutely no patience with meddlers.

    Turtles lay eggs around this time of year, which means they’re on the move, which means they cross roads, which means they get mashed. We’ve seen maybe half a dozen smashed turtles on our usual routes.

    Quite some years ago, we found one of its relations in the flower garden beside our house, where it climbed at least 18 inches of vertical concrete block to see what was inside. It was about two feet long, jaws to tail, and obviously a survivor:

    Snapping Turtle on wall
    Snapping Turtle on wall

    Those missing plates probably didn’t help its attitude in the least.

    It eventually klonked down to the driveway without our assistance:

    Snapping Turtle on driveway
    Snapping Turtle on driveway

    After a pause for gimbal unlocking and compass recalibration, it ambled off toward the Mighty Wappingers Creek. The wall gets much shorter to the right, which is likely where it climbed up.

    We wished it good hunting …

    Neither turtle was radio-active.

  • USB Micro-B Adapters

    The Sony HDR-AS30V camera has a USB Micro-B jack. One might think all three of these cables / adapters should work:

    USB Micro-B adapters
    USB Micro-B adapters

    But no:

    • The blocky Mini-to-Micro adapter on the top has no data lines
    • The Mini-to-Micro adapter cable works
    • The lower cable produces dependable disconnects

    There is, of course, no way to determine any of that, except by trying each one to see what happens; the product descriptions diverge from the truth in myriad ways.

    The camera came with a Micro-B cable that undoubtedly worked, but you try keeping track of one particular USB cable amid all the others.