Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr1906 :: Apt Spelunking 2: tvtime, phatch, and xstarfish

Windigo digs through his software repositories and finds another couple of gems

<< First, < Previous, , Latest >>

Thumbnail of Windigo
Hosted by Windigo on 2015-11-23 is flagged as Clean and is released under a CC-BY-SA license.
apt, tvtime, xstarfish, phatch, images, batch, video, wallpaper, terrible. 3.
The show is available on the Internet Archive at: https://archive.org/details/hpr1906

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:17:48

Apt Spelunking.

"Apt spelunking" is a silly term I made up for the act of searching through your package manager, App Store, Code Repo, etc with vague terms, and trying out random applications therein.
A public series started by Windigo.

Welcome to the another episode of apt spelunking! If you missed the first episode, I should explain. Apt spelunking is the act of aimlessly searching through your distribution's software repositories, and picking out the gems that you find. I call it apt spelunking because I use Debian, which uses the apt packaging format.

Let's jump into the first package: tvtime.

tvtime

https://tvtime.sourceforge.net/

The package tvtime is a simple one, but it does what it does very well. tvtime interfaces with a TV tuner - specialized hardware that allows your computer to process analog television signals, via coaxial or RCA video cables. If you have this hardware, usually an expansion card or USB peripheral, tvtime allows you to use your computer as an analog television.

tvtime binds to the card of your choosing, allows you to switch between NTSC and PAL modes (NTSC is what I use, that being the American standard), and shows you a wonderfully grainy video. It has filters that can help smooth out the image a bit, but it's still an analog video.

tvtime is video only, so you need to use something else to handle the audio of whatever you are hooking up. Often this is done by the hardware tv tuner somehow; my PCI card tuner has a 3.5mm jack that offloads any sound received over the coaxial wire, and I patch that into my sound card. RCA cables have separate wires for audio, and I plug those into my sound card via a converter cable.

I have used tvtime to hook up videogame consoles, VCRs, and older computers like the TRS-80. It's helped me to defeat Eternal Darkness, an old GameCube game that is still worth a look, and it's allowed me to digitize old VHS tapes we have lying around. More on that in another episode.

It is a fantastic alternative to keeping an older analog TV around. If you have older equipment that needs to dump analog video somewhere, tvtime and a hardware tuner makes for a great setup.

phatch

https://en.wikipedia.org/wiki/Phatch

This absurdly spelled program is incredibly good at what it does. Phatch, some sort of unholy combination of "photo" and "batch", is a GUI interface for assembling chains of actions to manipulate image files.

I use this program for web development to save time when creating static photo galleries or other types of images with similar constraints.

To use phatch, you assemble a set of operations (phatch refers to these as "actions") in an ordered "action list". I'll use my gallery thumbnail action list as an example.

There are only two actions in my thumbnail action list: "fit", and "save". Each action has a set of predefined parameters and options that let you tweak what happens to your files. The "fit" action resizes an image without goofing up the aspect ratio. You give it a box to fit the image in, and it fits it fully into that box and cuts off any extra edges. The most important parameters for this action are canvas width, and canvas height - which tells phatch how big the box is. The save action has parameters that let you set which image format to use, which folder to save to, and even what to name the file. For my thumbnails, I have it use the original filename, and append a "_t".

Once you have your action list together, you can tell phatch to run on an entire directory and include or exclude different file types.

There is much, much more to phatch than just resizing images. Sounds like another episode idea… anyhow, moving on!

xstarfish

https://packages.debian.org/hu/jessie/xstarfish

I left xstarfish until the end, because it's so much fun and so very, very weird. xstarfish generates a random, tileable background that can be dumped to a file, or assigned directly to the X display of your choice.

It uses some sort of magic randomsauce to pick a color palette, some patterns, and some other distortions to that you get a brand-new, unique background every time you run it.

It can also be started in daemon mode, with a timer, to automatically change your wallpaper periodically.

There are at least two problems with this.

First of all, let's start with the practical. You can set the size of the image xstarfish generates, by either using the -g flag and manually setting the geometry with a pixel width and/or height, or you can use the -s flag and set a general size like "small", "large", or "full". If you use "full", xstarfish automatically generates a full wallpaper for your display.

Since xstarfish generates randomness (which is often CPU intensive) and uses that to generate random filters (which can be hard on your CPU) and can be set to do it periodically (which, depending on frequency, could keep your CPU busy), this utility can be a resource hog. I have two monitors, each running 1280x1024 resolution, and when I set it to generate a new background every 10 seconds... well, it didn't. It just maxed out one of my CPU cores, and spit out a background every once and a while. Cutting it down to only generate a single monitor-sized image every 60 seconds made things much more reasonable.

The second, more pertinent issue with xstarfish is that it randomly picks colors and patterns. It is exceptionally random about it. Imagine for a moment that you needed to paint a room, and you wanted to pick random colors and patterns for a room in your house. You would begin by blindfolding a friend and pushing them into the paint isle at your nearest hardware store. Whatever three buckets of paint they bump into first, well, that's your color palette. What do you mean you don't like orange, sea foam and gunmetal grey?

Then, you take those paint cans and proceed to tie one to your ceiling fan, one to your eight-year-old child and swing the third around your head at a 35 degree angle. Fairly quickly, you'll have your own xstarfish-inspired decor.

With all of the potentially awful things that can happen, I really do like xstarfish. It's not something I keep running all the time, and a lot of the options remind me of early 90s Encino Man fashion and school photo backdrops with lasers. But sometimes the patterns are actually quite pleasing, and if I keep the tile size small, it reminds me of 90s web design.


That concludes the second installment of apt spelunking. Please don't let me take all the glory; take a tour through your package manager, whatever distro you use, and tell us about some cool stuff you find!


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2015-11-28 20:11:31 by Dave Morriss

Some interesting packages

I was intrigued by Phatch and installed it to try out.

It's intriguing though a bit counter-intuitive (for me anyway) since it seems to start by assembling a tool chain, which I didn't expect.

I then had difficulty working out how to apply the chain to some images. I shall persevere!

I also tried xstarfish and like what it produces.

Thanks for pointing these out.

Comment #2 posted on 2015-12-01 22:26:52 by Windigo

Re: Phatch

It's definitely not a terribly intuitive interface. I think it applies all of the actions you add (in order) to each of the images, but you have to be *very* explicit when assembling your chain.

Maybe I'll do a more in-depth show on how phatch works. Hmm...

Comment #3 posted on 2015-12-02 09:54:42 by Dave Morriss

Re: Phatch

Phatch seems to have a lot of potential. I can see a use for it myself; I like to assemble several pictures for HPR episodes, and I want to do things like strip metadata, shrink the size and make thumbnails. I can see that this might be possible but knowing how is the barrier. I looked at the documentation but it seems to be very short of actual instructions!

So, I know iPhatch is all about "Do Stuff To Stuff". I've understood the "Do Stuff" phase a little, but find the "To Stuff" part cryptic.

If you've mastered it yourself a show about your experiences would be great!

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
What is the HOST_ID for the host of this show?
What does HPR mean to you?