Image credit: Nicholas Moreau at WikiMedia

Jun 23, 2010

GIMP Deskew plugin

When you're scanning hard copy, you inevitably wind up with the image skewed at some perceptible degree, but it's really really hard (and slow!) trying to use GIMP's arbitrary rotation to de-skew the image. So I went looking for auto-rotate/de-skew plugins. I found two:
http://registry.gimp.org/node/22910 (which I haven't tried), and
http://registry.gimp.org/node/2958 (which I used).

The first one apparently requires you to draw a vector (path) to show it what should be perfectly horizontal, in the image. That's more work, and is slower, so I tried the other one first. Caveats:
  • the second is a compiled ELF binary ("deskew: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped") so it isn't very portable.
  • The first link in the plugin registry page apparently doesn't work, as per comments below - so I tried the Google Docs link, which allowed me to download the binary.
I chucked it in ~/.gimp-2.6/plug-ins and did a chmod u+x deskew (which is required for GIMP to exec it as a plugin). On starting GIMP and opening the scanned image, though, I couldn't find the plugin's menu option. That reminded me of the GIMP Procedure Browser on the help menu, so I went to the Help menu trying to find if it had loaded. It was here that I discovered something new (at any rate, I'm seeing it for the first time!): Plug-In Browser! Yup, it lists all loaded plugins, and lets you search them - and shows you where in GIMP's huge menus you can find the plugin's menu... :-) Nice!

Having found that it was at Filters > Misc > Deskew, I ran the filter. It works, and works well - straightened my image beautifully, without requiring any more interaction on my part! Now to crop the image and get on with the rest of my work on it :-)

Ubuntu Simple Scan Rocks!

Today, for the first time with Ubuntu Lucid, I had to scan something. With some trepidation, I ran the 'Simple Scan' utility, and decided to just click the Scan button on the toolbar, to see why it's been getting good press.

There's a good reason... it "just works". I didn't have to configure the scanner myself - the utility just found it on its own. I have an HP OfficeJet MFD, accessible over Ethernet - and the Simple Scan utility found it, and started a scan (flatbed, not ADF - again, correct choice), and let me save it. I made a small mistake of choosing 'Scan Photo', which saves the scanned image as a JPEG - not ideal for text. Still, I was pleasantly surprised - this is one change in Lucid that has actually worked flawlessly the first time I tried it. And what's more, it worked in "dumb user" mode - that is, I didn't have to go looking for Preferences or Options to try and tell it where to look.

I like!! :-)

Killing PulseAudio softly...

I've had rather a lot of complaints about Ubuntu 10.04 "Lucid Lynx", including lots about Gwibber and one or two about Empathy, and about non-working sound on my old low-power-hardware desktop, and my old Acer laptop, which isn't all that outdated.

The desktop sound problem isn't actually Ubuntu's fault alone - it appears to be PulseAudio. I installed Fedora 13 "Goddard" to replace Lucid, on the desktop, just to see if Fedora, at least, could work with the sound card and with Skype, or Empathy for Google Talk.

While the whole struggle is a pretty long tale of woe, the short answer is (after two days of installing, uninstalling, poking around, Googling, and trial and error), I finally decided to kick PulseAudio out of the Fedora picture rather brutally - by renaming its binary to a different name.

This, of course, broke many UI controls and stuff to do with audio - but it made Skype work (though the audio does cut off after about half an hour). Still, that's kind of an OK duration at which to have to reboot the comp to get sound again. My Mum uses the comp to Skype my sis, who's in Canada, and half an hour of chatting is way more than I can take, but they happily chat for a couple of hours, sometimes.

I wish my sis would find some time to try and set up a Google Talk account in Empathy under the Ubuntu Lucid install her hubby has done on their desktop... but I understand that caring for two young kids can take up your whole day and leave you exhausted. Perhaps that'll happen some day, and we can find out if the dropped audio is indeed a local problem, which I suspect it is, or if Skype is cutting short non-paying calls (IIRC I'd seen similar suspicions on the Net a long time ago, but haven't searched for that recently). I can even try re-enabling PulseAudio and see if Empathy plays nice with it (Google searches yielded discussion threads that said that Skype does not play nicely with PA).

I've been trying to find usable* distributions that don't use PulseAudio - plain ALSA - and haven't come up with any yet. Looks like everyone's piling on the PA bandwagon, and integrating it tightly into the distro, making it hard to eliminate without substantial breakage. If you know of any distros that *don't* use PulseAudio, please help me out and let me know which! I'd like to try them out and see if they work better than my self-broken Fedora.