Tagged: The GIMP Toggle Comment Threads | Keyboard Shortcuts

  • Akarsh Simha 3:45 pm on October 23, 2008 Permalink
    Tags: Genius MousePen, , The GIMP, WizardPen, Xournal   


    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!

  • Akarsh Simha 12:10 am on March 8, 2008 Permalink
    Tags: , Image Processing, Orion, The GIMP   

    Processing Orion 

    Shashank took this wonderful wide-field photograph of constellation Orion sometime at Shivanahalli:

    Orion by H J Shashank (Unprocessed)

    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 :-P. 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.Astro Proc Tutorial.

    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)

    Astro Proc Tutorial.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.

    Astro Proc Tutorial.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.


    Astro Proc Tutorial.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.

    Astro Proc Tutorial.Astro Proc Tutorial.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 theAstro Proc Tutorial.Astro Proc Tutorial. 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 mayAstro Proc Tutorial.Astro Proc Tutorial. 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.

    Astro Proc Tutorial.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.

    Astro Proc Tutorial.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?


    Astro Proc Tutorial.Astro Proc Tutorial.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.

    Astro Proc Tutorial.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.

    Astro Proc Tutorial.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:

    Orion by H J Shashank

    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.

    • Akarsh Simha 12:12 am on March 8, 2008 Permalink | Log in to Reply

      Thanks to WordPress for screwing up so many things, such as the placement of the screenshot thumbnails and the cropping of the final image. Excuse me for my laziness to try and fix these errors! 😛

    • Ed 12:22 am on March 8, 2008 Permalink | Log in to Reply

      If you want to get even more out of it, you can create a sort of fake flat frame where you create an image with that vignette area as a white fuzzy snowball and then you can have a better black point to get rid of skyglow. I’ll bet there’d be even more detail in there that way. Good job, though.

    • Akarsh Simha 12:28 am on March 8, 2008 Permalink | Log in to Reply

      Ahh… yes. I think I understand what you mean. I’d tried that earlier sometime and it worked pretty well. I thought that the noise extraction from the decomposed image would remove that as well.
      I’ve never done astrophotograph proper or learnt processing by the book before, so I don’t understand terms like “flats” too well… but I get what you mean. Thanks for the suggestion. Will try that as well.,

    • Ed 2:58 am on March 8, 2008 Permalink | Log in to Reply

      just do some searching on Google on how to take a good flat frame – you can create one yourself (it’s not as good, but better than nothing) and the results will really surprise you – there’s even more data in there than you think!

    • Prasanna 6:39 am on March 8, 2008 Permalink | Log in to Reply

      Hope this comes in handy for many people 🙂

    • Dr Suresh 11:03 am on March 8, 2008 Permalink | Log in to Reply

      Flats are taken to remove the vignetting in a picture.Flats are taken at ISO 100 ,with t he focus and the position of the camera SAME as the subs. The histogram on the back of the camera should read between 1/3 to 1/2 ( adjust the timing).Pic is shot in the evening sky with scope pointing east .Normally 9 flats should suffice.
      Congratulations to Shashank on the briiliant manual tracking and Akarsh on the excelent processing.

  • Akarsh Simha 9:44 pm on March 3, 2008 Permalink
    Tags: , Fourier Transform, Noise Reduction, The GIMP, Wavelet Filters   

    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 Image of M42 before noise removal by editing the FFT spectrum.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 frequencyImage of M42 after noise removal by editing the FFT spectrum. 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!

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc