Archive for August, 2005

Base Name

Tuesday, August 23rd, 2005

As I’m always happy to see a little unix utility saving me a lot of time, I
will start this unix tip section in my blog, hoping to bring joy to the likes
of me.

Today’s tip comes from the fellow designer Garrett. In my lousy little bash scripts I have
resorted to using my poor regex skills and sed to strip out an
extension from filename or remove a directory prefix. It turns out that there
is a neat utility that does it for ya. It’s called basename. The
syntax is basename NAME [SUFFIX] where NAME is the filename that
includes a file path. The optional suffix parameter allows you to strip out an
extension. As an example is always most useful, here’s how to render a bunch of
svgs into the current directory using inkscape:

# for svg in /home/jimmac/icons/*svg; \
do stripped=`basename $svg .svg`; \
echo “converting $stripped to PNG”; \
inkscape -e $stripped.png $svg;
done;

RGB Noise

Tuesday, August 23rd, 2005

One of the very common tasks a digital photographer undergoes is removing
noise. While there is a plentitude of methods, the one I have been using with
GIMP most often is Selective
Gaussian Blur
. Unless the grain contrast is too high, keeping the blur
radius low and the delta value approximately the same value gives a decent
result without losing too much detail. The process is quite CPU intensive
however and for large batches of my six megapixel images it can take a
while.

#

Selective Gaussian Blur isn’t the only “smart” blur filter for GIMP that
tries to keep edges inctact. Browsing through the registry resulted in another gem
- DCam Noise by Peter
Heckert. Tweaking the parameters is only for the brave, so apart from the Max. Radius I found Luminance and Color Tolerance worth exprimenting with. The major issue I had with Selective Gaussian Blur still remains though. It’s quite CPU intensive.

What I need is a quick little hack to fix the most annoying aspect of CCD
noise. I don’t mind even a rough ISO 1600 noise as long as it’s uniform across
the RGB channels. Well it isn’t :) Each channel seems to have a “different
seed” for the noise making it really unpleasing to look at on homogenous
surfaces.

#

There appears to be a simple
trick
to get rid of this issue – creating a copy of the image and applying
a median filter on the copy. Then the overlay mode is set to only
affect the color, preserving the luminosity information from the layer below.
In GIMP, we have the Despecle filter,
but I have been unable to get rid of the independent RGB noise in most cases.
Of course applying selective gaussian blur works great, but then we’re losing
the key point of this process – speed. If the noise varies only slightly a
simple gaussian blur works ok as the eye is much more sensitive to luminosity
than color.

So to end up this entry in a typical manner – if you have found a neat
and fast way to get rid of the RGB channel independent noise, I’m eager to hear
your tips.

Power Abuse

Tuesday, August 23rd, 2005

Looks like Bublan’s ways of dealing
with alternative culture
have inspired similar actions
across the ocean
. Quite sad.

Alsa Voodoo

Sunday, August 21st, 2005

The ALSA sound system is really sophisticated, but also very
mortal-unfriendly. Doing a trivial task such as setting the default soundcard
seems to be beyond me. While Ubuntu
doesn’t ship alsaconf for some reason, I wasn’t able to find out how it does
its autoconfiguration magic during installation. Having two soundcards isn’t
uncommon. I hapen to have the setup at two boxes actually. The onboard
soundcards are usually so crappy that one wants to install a proper PCI
board. Of course in both cases, ubuntu prefers the wrong board.

After a bit of research I fished out a config file that allows to set the
prefered soundcard. Unable to parse and understand the config file I wasn’t so
lucky to make this work for legacy applications using OSS. Those seem to keep
on using the other soundcard. The config file, which goes either to
~/.asoundrc or globally to /etc/asound.conf,
currently looks like this:

pcm.!default {
type hw
card 1
}

ctl.!default {
type hw
card 1
}

Reading the alsa documentation is like trying to speak japanese for me, if
anyone knew how to fix the oss output for me, I’d be greatful.

Update: After reading this bit, I tried adding the remap to /etc/modprobe.d/alsa-base and restarting alsa, but without any success.

alias snd-card-0 snd_emu10k1 #I want this
#to be the default sound card
alias snd-card-1 snd_via82xx

Update 2: Success! Adding explicit index attribute
to the sound card module seems to finally do the trick. Thanks Aleksander.

Replacing DSLR with a Few Compacts

Tuesday, August 16th, 2005

I bumped into this highly interesting story of a photo reporter using a few compact digicams instead of a DSLR with a nice example of czechnology to take burst shots:

He carried two C-5050 cameras on straps around his neck, with one strap cinched shorter than the other, so that the cameras hung at slightly different heights on his chest. The cameras were set for 3-shot burst mode. When a long sequence of shots was called for, Majoli fired a 3-shot burst with one camera, dropped it, grabbed the other and shot a burst with it. The first camera wrote
its images to the card, thereby clearing its buffer, while Majoli shot with the second. He just kept rotating from one to the other for as long as the action in front of him continued.

I couldn’t agree more on the suckiness of carrying a set of huge adapters for each and every gadget out there. If at least the hardware makers would standardize batteries/adapters within their product lines.

Camera with GSM ;)

Sunday, August 14th, 2005

So I’ve replaced my rusty D70 with a new cam. Not quite :) , but the D750i‘s camera is pretty decent for a phone. Sony released three phones being pretty much exactly the same except for acessories and firmware. I got the D750i, cheapest of the three, which appears to be a T-Mobile branded w800, not too much different from the k750i.

In Linux the phone acts as a usb-storage device when connected using the USB cable. Bluetooth OBEX transfers work fine as well.

What I wasn’t able to get working and I would appreciate any help from lazyweb is external GPRS connections. While I was able to connect from within the phone, using jmirc, connecting a computer or my palm through the phone remains a wish. The modem refuses to accept the init string I used in my old siemens s55 (at+cgdcont=1,"IP","internet"). If I leave that out and just dial *99#1, the phone bails out and pppd dies unhappily:

GNOME PPP: Connecting...
GNOME PPP: STDERR: --> WvDial: Internet dialer version 1.54.0
GNOME PPP: STDERR: --> Initializing modem.
GNOME PPP: STDERR: --> Sending: ATX3
GNOME PPP: STDERR: ATX3
GNOME PPP: STDERR: OK
GNOME PPP: STDERR: --> Modem initialized.
GNOME PPP: STDERR: --> Sending: ATM1L3DT*99#
GNOME PPP: STDERR: --> Waiting for carrier.
GNOME PPP: STDERR: ATM1L3DT*99#
GNOME PPP: STDERR: CONNECT
GNOME PPP: STDERR: ~[7f]}#@!}!}!} }8}#}$@#}(}"}'}"}"}&} } } } }%}&,t}1}>8}#~
GNOME PPP: STDERR: --> Carrier detected.  Waiting for prompt.
GNOME PPP: STDERR: ~[7f]}#@!}!}"} }8}#}$@#}(}"}'}"}"}&} } } } }%}&,t}1}>r[11]~
GNOME PPP: STDERR: --> PPP negotiation detected.
GNOME PPP: STDERR: --> Starting pppd at Sun Aug 14 04:44:18 2005
GNOME PPP: STDERR: --> pid of pppd: 759
GNOME PPP: STDERR: --> Using interface ppp0
GNOME PPP: STDERR: --> pppd: X3
GNOME PPP: STDERR: --> pppd: X3
GNOME PPP: STDERR: --> pppd: X3
GNOME PPP: STDERR: --> pppd: X3
GNOME PPP: STDERR: --> pppd: X3
GNOME PPP: STDERR: --> pppd: X3
GNOME PPP: STDERR: --> Disconnecting at Sun Aug 14 04:44:23 2005
state: 0
state: 0
GNOME PPP: STDERR: --> The PPP daemon has died: PPP negotiation failed (exit code = 10)
GNOME PPP: STDERR: --> man pppd explains pppd error codes in more detail.
GNOME PPP: STDERR: --> I guess that's it for now, exiting
GNOME PPP: STDERR: --> The PPP daemon has died. (exit code = 10)

If you know what sort of voodoo needs to be applied in the internet profile or what magical init string the phone accepts, I would be greatful. Uncle google will not talk to me.

Of course replacing the custom t-mobile firmware with w800′s would be rad as I am not using t-mobile. But I’m not sure it’s possible at all.

Update: Thanks for the help folks, just using the connection ID in the dial string is all that is needed (*99***[CID]#). I will post some sample images from the phone soonish.

NLD Warpspeed

Monday, August 8th, 2005

The basic premise of a functional wallpaper is that should be fairly low
contrast, minimally saturated and overall should not steal the focus from the
actual items on the deskop.

Personally I like more neutral, simple wallpapers. Abstract macro
photography, GIMP’s noise filter are always a good start. However, I always
wanted to go overboard and do one of those overcrowded techoid wallpapers sites
like GFX Artist are full of.

#

The core of the wallpaper has been rendered in Blender, many elements created in Inkscape. Final composition done in GIMP. The lorem ipsum text has been laid out in
Inkscape though. GIMP’s text tool has to catch up in the flowed text
department.

And I Thought Those Times are Over

Monday, August 1st, 2005

Based on the prospect of damages of over 5000 CZK (USD $200) about 1000
heavy suits with tear gas, water guns and a helicopter were deployed. People
who came to enjoy Czechtek were not
allowed in the country based on having tattoos and wildly colored cars. The
roads toward the leased land were blocked by the police. 1000 armed policemen
in 37 degrees celcius given the order to “give the dopeheads what they
deserve”.

Without the web I would still think there was no valid contract, the police
measures were appropriate and only a few incidents occured, the highway was
blocked by the youngsters and not the police. Well done, comrade Bublan.

For more information, see http://www.policejnistat.cz/?lng=en.