Posts Tagged The GIMP
WP8060U!
It was relatively very trivial to get the Genius MousePen 8″x6″ tablet working with Linux. Google gave me a result from the Ubuntu Wiki. The driver built with no trouble and it worked.
Well, that’s because I checked up on google before buying the hardware and favoured a Genius MousePen over some iBall foo because it had a (“sureshot”) Linux driver.
The tablet works pretty well, but there are some problems. It’s hard to use it as a general purpose mouse, but it works correctly when it comes to dragging, which means it works well for drawing and writing.
I found a software called xournal [Grr... it is a GTK app] in my APT cache. So I just did apt-get install xournal and I could comfortably write down stuff and export to PDF!
Today, I saw if I could actually draw with it. Being the terrible artist (I used to hate drawing at school), I ended up “tracing” this from a photograph of mine. So this is v1.0:
5 comments October 23, 2008
Processing Orion
Shashank took this wonderful wide-field photograph of constellation Orion sometime at Shivanahalli:
I enjoyed processing this photo the most, so I thought I’ll reprocess the same and this time, write a blogpost on how I did it, so that the strange techniques I use may be available to others. I’m going to avoid explaining details on how to do small operations with The GIMP, which is what I’m going to use here to process this photograph.
The GIMP is free and open source software and can be downloaded for both Linux and Windows. It is highly recommended that you encourage and use Free and Open Source software. The GIMP can do most of the things that a copy of Photoshop costing 30k Rupees for free, and much more!
Step 1: Set your monitor contrast and brightness to a good amount. See Jerry Lodriguss’ page on how to do this professionally. I do it randomly to my satisfaction
. This is important, because the last time I processed this, the outcome was good looking at my low contrast (which I use to protect my eyes) but it looked really artificial and ugly at high contrast.![]()
Step 2: Open the photograph, investigate what Layers are. Layers are used extensively while processing. Familiarize yourself with the interface of The GIMP. The Layers dialog can be quickly fired by hitting Ctrl+L (atleast in my version of The GIMP)
Step 3: We now set the black point. Go to Colors -> Levels (Layers -> Colors -> Levels in older versions) and click on the ‘pick black point’ button. Then, select a point on the image that corresponds to the skyglow in the image. Because of vignetting, the skyglow is not uniform, so I chose a point where it is somewhere inbetween, so that I don’t lose faint stars, but still cut out enough skyglow.
Step 4: Adjust curves to improve the photo. The Curves tool is found at Colors -> Curves (Layers -> Colors -> Curves in older versions). Enhance the useful details and kill the noise. Of course, be careful to preserve the fainter stars as well. Don’t try to supress all the noise – you’ll lose the nebulosity.
.
Step 5: Decompose the image into Red, Green and Blue Channels. To do this go to Colors -> Components -> Decompose and choose RGB. The GIMP will open a new window with a grayscale image. If you fire up the layers dialog, you’ll notice that it has the R-G-B channels as separate layers. So we can work on each channel just as we would work on a layer. In this screenshot, the Red Layer is shown. Notice that the nebulosity is strong in the red channel because of the Hydrogen emissions.
![]()
Step 6: Find the noise. It involves some thinking to decide how you will catch only the noisy skyglow and remove the sensible parts of the image. In the case of this example, the noise was mostly in the Red and Green channels, so I could use some combination of them to extract only the![]()
noise. I found that I could do that best by doing a “Grain Merge” between the Red and Green layers and subtracting that from the Green Layer. Then, merge the layers (Ctrl+M) and use the Curves tool and the Eraser / Paintbrush tools to eliminate all part not noise. You may![]()
then copy the noise layer and paste its of the image that are into the original colour image. (Remember that we were working on the decomposed grayscale image till now). In the Layers dialog, that will appear as a ‘floating selection’. Click on the ‘Create new layer’ button to make it into a new layer.
Step 7: Colorize the noise using the Channel Mixer (Colors -> Components -> Channel Mixer). Give the grayscale noise layer that we pasted in the previous step a hue of the colour of the noise in the original image. In the case of this photo it was yellowish-green. So I went to the Channel Mixer and raised the intensities of the contributions to red and green channels.
Step 8: Set the layer mode to subtract, to subtract the noise from the image. It gives a real nice feeling to see that skyglow vanish! It was worth the effort, wasn’t it?
.
![]()
Step 9: You may want to enhance the nebulosity by adding that over again to the photo. Go back to the decomposed image and subtract the noise from the red channel. Then combine the layers, copy, paste into the main image. Again, convert the floating selection into a new layer, colorify the nebula with a red tint using the Channel Mixer. Change the mode of the nebula layer to value and the nebulosity will increase.
Step 10: Now, merge the layers (Ctrl+M) and if required adjust curves to do some final adjustments. I had some more greenish skyfog, so I killed that by adjusting the curves for the Green channel. I also tampered with the curve for the value channel to improve contrast.
Step 11: If you like, (I do!) you may want to give the diffuse stars effect by using Curves and Gaussian Blur (Filters -> Blur -> Gaussian Blur) repeatedly. To do this, first duplicate the image layer and blur it with a radius of about 20 px. Then use curves to kill all the fainter stars. Again, use blur to increase the diameter of the bright stars. Repeat till you are satisfied. If required (I had to do this) make colour adjustments by adjusting curves of individual channels as well. Once you get nice halos of bright stars, change the layer mode to screen. I also had to kill the blurred halo of Orion Nebula while doing this, to preserve detail.
Ok… so this is what I got at the end:
Shashank has really done a great job in taking this photo. This is a long exposure (> 10 minutes. I don’t know the details) manually tracked photo. Shashank does a very good job with manual tracking for the kind of equipment he has. You can also see the stars of Lepus highlighted by the diffuse stars effect. You can see the Flame Nebula,IC 434 emission nebula, Great Orion Nebula and Barnard’s Loop.
6 comments March 8, 2008
Hikergotchi tutorial :-P
If you’ve been looking at the posts on my friend Prasanna’s blog, you would’ve come across his recent hackergotchi tutorial.
Now, I’m going to demonstrate something similar – how to make your hikergotchi.
Hiker is a word that I associate not with the typical trekker, but with someone who is frequently asked to take a hike!
So, you’d want to make yourself look as dumb as possible. (I would’ve wanted to use a better word instead of hiker, but I’d prefer my blog to be free from swear words).
Now here’s someone who was dumb enough to pose for a hikergotchi. So let’s make one for him:
Step 1: Select your face using the Rectangular select tool in The GIMP. Then crop to selection.
Step 2: Use the intelligent scissors to select only the face of your unintelligible self.
Step 3: Finish selecting only the face, invert selection, add alpha channel to layer, and hit delete. Effectively, this will remove the background and leave transparency behind.
Step 4: Drop shadow!
And this is what you should’ve got now:
3 comments March 4, 2008
FFT on Images, and The GIMP!
I didn’t know what this “wavelet” processing meant. Yesterday, on a trip to Yelagiri, my friend Hemant was tampering with the wavelets in Pleiades Pixinsight to process his marvellous image of the Eta Carinae nebulosity that he had captured the previous night. He explained that it was just the Fourier transform of the image, treating pixel value as a function of the two (discrete) co-ordinates. He also explained how noise has only high frequencies, so passing the FT of an image through a low-pass filter would eliminate noise and at the same time, blur the image etc.
Today, I decided to do some reading and experimentation with this. So I ran too Google, which faithfully presented to me this wonderful article from one Prof. Brayer in some CS Department in some university – probably part of some course material on computer vision.
With those wonderful examples, I understood the idea, although a bit slowly. So the idea was that all sharp details like edges of images would (like our favourite Dirac Delta function) produce very large frequency components as well, while blur details (like the DC component) produce only very low frequencies. So blurring an image would translate to a compression of its Fourier Transform.
After some hunting, I found out that The GIMP had Fourier Transform plugins. I used the ones found here.
It was straightforward to install. It required fftw and gimptool, which I obtained by executing:
sudo apt-get install fftw3-dev libgimp2.0-dev
on my Debian system.
After installation, as explained in the Wikibook here I found two new options in Filters -> Generic that would do the FFT and Inverse FFT on an image, to produce another image. The advantage with working this way is that GIMP’s amazing image processing flexibility can be applied to the Fourier Transform, to obtain various effects. The gradient tool, the smudge tool and the blur tool proved to be pretty useful.
After reading through some material, I decided to try my hand at re-processing
an old photograph of M42 that some of us at IITM took with the institute’s telescope and Dr. Suresh Mohan’s Philips ToUcam webcam. The trouble with this particular image was that, for some reason – maybe manufacturing problems – the webcam was producing “periodic” vertical lines in the image – and the nebula was just about as bright as the lines!! I decided that this will be the ideal place to use the FFT, after looking at the example in the GIMP Wikibook.
After much trial, I understood that I should not remove the higher frequency
components – because that would only affect the edges, that too negatively. I tried killing the low frequency components as well, but that didn’t do much good either, because it only removed the nebulosity and black background. After some playing around, I realised that I should kill the intermediate frequencies. So I took the smudge and blur tools and blurred out some of the intermediate frequencies on the horizontal frequency axis. After doing the inverse FT I compared the final and initial images to see a whole world of difference! It had worked!!
I’m excited – I finally “understand” what adjusting ‘wavelets’ / wavelet filters mean. As Prasanna told me today in the mess, wavelet filters work exactly like the equalizers in sound systems – now, that’s a very powerful analogy. Immediately, you’ve got the intuitive feel of how to work with wavelets. Thanks Hemant, Prasanna!
3 comments March 3, 2008

