Slashdot Mirror


Using The GIMP (or Photoshop) to Improve Photos?

Nom du Keyboard asks: "Is it possible to use The GIMP (or Photoshop) to improve my digital photos? I have a mid-range 7.1MP Olympus camera capable of shooting in Raw mode. When I inspected a section of clear blue sky on a bright, sunny day (which I've long believed to be relatively good reference of uniform color and brightness) I was surprised (disappointed, since I expect digital perfection) at the variance in adjacent pixels. It's also a quick way to identify any bad pixels. Surprisingly, actual photos from this camera look pretty good despite this variance so far. Moving on from that point it led me to wonder that, if you shot a uniform white surface, perhaps blurred as much as possible to avoid any imperfections in the surface itself, could a correction (adjustment) layer be created in GIMP or Photoshop exactly tuned to your camera that fixed the variations in your CCD sensor and improved the image quality in the process. Any thoughts?"

33 of 111 comments (clear)

  1. try it by tverbeek · · Score: 2, Insightful

    I don't know. Why don't you try it?

    --
    http://alternatives.rzero.com/
    1. Re:try it by smallfries · · Score: 2, Informative

      I'd try it twice, with two different but supposedly uniform surfaces. I'll bet that the fluctuations in pixel intensities aren't uniform across both surfaces as they're not caused by a systematic bias in the CCD. Rather they are caused by random noise in the circuit.

      If it turns out that there is a systematic bias (ie one that you can correct in the GIMP with a static image) then you would be best off taking a picture of something as black as you can make it. The inside of a bad should do. And then as light as you can make it (not really sure about this one - lighbulbs maybe). From the two masks you can make the image that you want without needs to make a perfect surface first.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
  2. Interesting idea by Aladrin · · Score: 3, Insightful

    That's an interesting idea, but it assumes some pretty clean conditions. The light has to be absolutely the same over the entire surface, it would probably need to be blurred as you said, the surface would have to be absolutely the same color everywhere (no dust, no marks), the surface would to be completely non-reflective, and probably some other things that I haven't thought of. It would be extremely hard.

    It also assumes that the variations are always the same, and that the variations in your photos are from defects and not from the natural color differences in the real world and the digital camera's attempt to map them to a very restricted color palette.

    --
    "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    1. Re:Interesting idea by Goeland86 · · Score: 2, Informative

      that's not too hard. Get a projection screen with a spotlight aimed at it. There's your screen. Then you can create your layer fairly easily, no?
      Any meeting room, or multimedia classroom will have one of those, anywhere with a projector will work. You just need a pair of tripods, your camera and a fairly powerful wide range spotlight. Done!

      --
      ---- I am certain of only one thing : I know nothing else.
  3. Learn about photography by linuxbert · · Score: 5, Informative

    What you describe is normal, and your question exhibits a lack of understanding about white ballence.
    essentially, if your white is right, then all the other colors will be as well. your camera has several settings to compinsate for various light types (Tungsten, Flourescent, Daylight)Yours is probably set to AWB (Auto) which is easy - as the camera will figure it out pretty well and a Custom - which you can configure based on the lighting by shooting a grey card - which is a card that is 15% grey (Or there abouts) that the camera can then use to figure out what true white is.

    The variation in pixels can also be the result of the ISO setting you are using. 100 has the least noise, but also requires longer exposures. higher settings react faster, but have more noise (400,800,1600) This is a tradeoff between desigered exposure and ambiant light.

    I would suggest reading Strobist for more on lighting. There are also several other sites dedicated to post processing images, that you may find helpfull. it also might be worth looking at the various pool discucssion groups on Fliker.

    -Peter

    1. Re:Learn about photography by Frobnicator · · Score: 5, Informative
      You are right that light balance and natural noise are both very important.

      Take for example the camera-assistant production slates (those little boards you see movie makers use with the clapper on top). They do a lot more than just showing the script location and film location, but they also have little black and white (and gray) lines on the clapper. Those are amazing tools that are deceptively simple. The clapper makes a sharp noise that lets you sync and balance the audio, digital boards will record the sync for individual film frames, and the lines provide for image calibration.

      The black, gray, and white boards allow you to balance the brightness in post production exactly the way the original post was looking for.

      Most boards also have calibrated colors to help balance those, as well.

      Shooting slate is a very important step in good photography, both for stills and motion pictures.

      And to the posters suggesting trying to eliminate all natural noise in photos, you don't really understand what you are talking about. Your eye expects noise in the real world.

      Photos need natural noise, they look unnatural or cartoonish without it. Traditional photographs are full of noise because the silver halide gelatin and other chemicals are not perfectly uniform. The chemicals naturally clump up and form noise. (This property makes it easy to identify tampered photos since the natural noise is different between two areas.) Even digital photos get noise when you print them or display them on your screen. If your camera automatically smoothed out all the noise, the image would look like a cartoon or a naively ray-traced image.

      As far as using image editing apps such as the GIMP or Photoshop, yes they are able to do a great job with digital images but they are limited by the knowledge and skill of the human using them.

      --
      //TODO: Think of witty sig statement
  4. Noise ninja by Illusion · · Score: 4, Informative
    See Noise Ninja for well-known commercial software that does this. There's apparently now also a Linux version.

    While playing with it a while ago, I found that JPGs compress something like 25-33% better after you remove the CCD noise. Improving the image quality while making the images take less space seems like a nice combination. :)

    This seems like it would be great to get in the hands of more people as a free software app or plugin, but I'm not aware of any.

    -- Aaron

    --

    Aaron

  5. Good idea, but use black instead of white. by NereusRen · · Score: 5, Informative

    Using the sky or a white piece of paper may be interesting, but it probably won't give you anything you can use to calibrate the rest of your photos.

    A better bet for isolating the noise your camera generates is to take completely black photos, using the lens cap and some extra covering (and a dark room) to make sure absolutely no light hits the sensors. This will let you make raw images of the "dark noise" and "bias noise" that your camera generates, and subtract those images from your real photos before doing any other processing.

    Details of this method can be found here: http://photo.net/learn/dark_noise/.

    1. Re:Good idea, but use black instead of white. by zippthorne · · Score: 2, Informative

      Better cameras already do this, by taking a picture with the shutter closed. You can sometimes select between taking a "dark frame" for every picture and taking a single "dark frame" to apply to all subsequent frames. Best to read the manual for your particular model to see if you have these features.

      --
      Can you be Even More Awesome?!
  6. Yes. by oskard · · Score: 3, Interesting

    If we saw a sample of the photos, it would be easy to determine if they could be fixed. Its hard to understand what the exact problem is from a text description, but the general answer is: Yes, anything can be done with The GIMP / PS.

    --
    Sigs are for Terrorists.
  7. Yes Exactly! Only Backwards.... by DonnarsHmr · · Score: 5, Informative

    You're almost right. The method you're using is called Dark Frame Subtraction. The idea is that you photography the non-random noise inherent in the sensor and then take that out of the captured images. To do this, you make an image that is completely black (i.e. body cap on the front of the camera and viewfinder cover on the back) at the same temperature conditions and for the same length of shutter speed as the image you are trying to fix. Then you add that as a layer in photoshop, subtract it from the real image, and the non-random noise disappears.

    However, it is MUCH more likely that the noise you are complaining about is random thermal noise, which is not treatable via Dark Frame Subtraction. Because it's, well, random noise, it'll be different in every shot. There are several photoshop plugins that can address this issue. In my opinion, the most effective and easiest to use of them is Noise Ninja.

    1. Re:Yes Exactly! Only Backwards.... by hankwang · · Score: 3, Interesting

      Then you add that as a layer in photoshop, subtract it from the real image, and the non-random noise disappears.

      I doubt that that will work. Once in the computer, the pixel values are not proportional to the absolute brightness, see gamma correction on wikipedia. You would need to do the substraction on linearly encoded data (12 or more bits rather than 8). Maybe photoshop can indeed do this, provided you find the right settings, but GIMP as far as I know doesn't.

    2. Re:Yes Exactly! Only Backwards.... by tigersha · · Score: 2, Interesting

      Ok here is a list to quell your doubts:

      Photoshop has:

      Adjustment layers which allow you to change filters after the fact
      Filter layers which allow you to switch a stack of filter on and off and season to taste after tha fact (in CS3)
            These two features allow you to view image processing more like a spreadsheet in the same way that Excel is better than a calculator

      Can do filters on the GPU in hardware (in CS3)
      Save for web
      Absolute color systems (Lab color)
      Capability too do color proofing for printing presses (needs absolute color conversions)

      Import and manipulation of smart object layers and changing them after the feact
      Layer styles which allow you to change the llayerr after the fact. With copy and paste which are really useful to make lots imagges in the same style
      16 and 32 bit and HDR color
      Better macro recording (Gimp is probably easier too program though)
      The history brush
      The patch tool
      MUCH better image size interpolations (if you resize an image iit look better in PS
      A text tool that dooes preview on the image and not in some box outside of it
      Much better text layers
      A UI that was not written by the spawn of Satan

      Basically, Photoshop is like a spreadsheet and GIMP is like a calculator. PS allows you to do do much better look and feel stuff

      An no, the price comparison argument does not really hold. Gimp's competitor is Photoshop Elements which has all the features except the press stuff.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  8. Sure Can. by philibob · · Score: 3, Informative

    You already can. Some cameras let you shoot against a blank white area to compensate for dust particles on the CCD. It's called "Dust Reference" in Nikon Capture, which works with most of their DSLRs.

  9. Something like this? by Quixotic137 · · Score: 3, Informative
    1. Re:Something like this? by fossa · · Score: 2, Informative
  10. yes.. by slashkitty · · Score: 2, Informative
    I don't know about your particular problem, but other camera flaws have been fixed with processing. For example, if your camera adds a vignette, you shoot a piece of white paper, then remove that shading from all the photos. This is gives you an automatic, scriptable way to do that with ImageMagick:

    Vignettation Removal

    --
    -- these are only opinions and they might not be mine.
    1. Re:yes.. by YttriumOxide · · Score: 2, Informative

      Note to anyone that plans on doing this - good digital SLRs have this kind of function built in and you should only consider this if your camera doesn't. The quality of the adjustment will actually be significantly worse unless you ensure:

      1. The light is hitting the white paper evenly
      2. The white paper is a nice bright and clean white (don't even THINK of using standard office copy paper)
      3. The paper is of a very short grain
      4. There is no curving or folding in the paper
      It might be better to consider the alternative black reference - while a good system would use both, a system which has neither is easier to do with a black reference than a white one.


      (disclaimer: I don't know much about photography, but I know a LOT about paper, colour theory and image editing)

      --
      My book about LSD and Self-Discovery
      Also on facebook as: DroppingAcidDaleBewan
  11. Not quite... by Joe+Decker · · Score: 3, Informative
    Discounting truly bad pixels, variations in the sensor readings on an even sky have two sources--pure sampling noise from the fact that the sensor is only reading a finite number of pixels, and a more constant, but still varying per-pixel offset. It's likely with a daylight shot that you're primarily seeing the former, the latter effects tend to be more significant during long exposures doing astrophotography. Check out the "Digital Rebel" astrophotography page here, it outlines a procedure for measuring and subtracting off this varying per-pixel offset, but notices you need to essentially compute the "dark frame" (or offset) for a particular set of conditions (temperature, ISO, exposure time). That subtraction could be done in PS, but again, you really need a new "dark frame" for each shot.

    It is possible to smooth rough skies and such in Photoshop, I can't speak from personal experience with the GIMP but I'd expect something similar would work. I'd take the image, duplicate a regular (non-adjustment) layer on top of the main image, call that second one "smoothed"), blur it (Gaussian blur, fiddle with the radius to keep the effect gentle), add a layer mask to "smoothed" and paint it so that it only targets the sky in a shot. You may end up finding that you want to leave a little noise in the resulting image to avoid posterization, if your results are too smooth you can always adjust the opacity of the smoothed layer downward.

  12. Clear blue sky != monochromatic by Gothmolly · · Score: 2, Insightful

    a) If you are using anything above ISO50 on a cheap digital (like yours), you will get ISO noise
    b) blue sky is not really blue, you can't expect 7.1 million pixels to all agree
    c) there may have been microscopic dust on your lens

    Basically, you're looking for your camera to be Adobe Illustrator, and it isn't.

    --
    I want to delete my account but Slashdot doesn't allow it.
  13. Yes by YGingras · · Score: 3, Informative

    Scale down the picture, choose cubic interpolation and you're done. You can't fix the original, the information is scrambled already, but you can use the information of the larger image to average the pixels of the small image to get something clean. When you read X mega-pixels, you should know that this is a scam. There are no camera out there that will give you an image usable at X resolution but you can still have pretty pictures at X/2 (which is roughly 3/4 of the side on the original).

  14. Something similar by ceoyoyo · · Score: 4, Informative

    Something similar is done in astrophotography. There are two kinds of fields you can remove from your images. A dark frame (taken with the lens cap on) is subtracted to remove things like pattern noise, hot pixels and amp glow that appears in images. A flat frame is then used to remove multiplicative effects, like vignetting and dust spots. Acquiring a flat frame can be tricky. One of the best ways is to use a translucent lens cap and a fairly bright light that provides a fairly uniform illumination.

    However, the effects (unless there's something seriously wrong with your camera) are really only noticeable for long exposures.

    1. Re:Something similar by dougmc · · Score: 2, Interesting

      One of the best ways is to use a translucent lens cap and a fairly bright light that provides a fairly uniform illumination.
      We used to just point the telescope up during the day and take a picture of a nice blue sky -- it worked very well. (Of course, this was 15 years ago, and maybe things have changed somewhat and there are better ways to do it now.)
    2. Re:Something similar by gsn · · Score: 2, Interesting

      Still do skyflats :-) but it does depends on what passband you care about for imaging - twilight sky flats work pretty well in B. These are sort of bothersome on larger telescopes because you don't want to saturate but you do want good statistics but you don't want to cut into observing time, and you have to slew between each one to reject any bright early rising stars. A lot of big telescopes use quartz lamps to illuminate a screen and image that. Dome flats are pretty common these days, especially in spectroscopy, but for photometry its nice to still get a set of sky flats. I take a bunch of flats for each instrument setup and median them before flat fielding. There are more sophisticated methods around the corner that will vastly improve calibration for projects like Pan-STARRS and later LSST - http://arxiv.org/abs/astro-ph/0609260 (Disclosure: I work with some of the people on said paper but not on this project)

      Dark frames aren't actually as useful anymore for instruments on larger telescopes that use LN2 or a cryotiger for cooling.

      --
      Reality must take precedence over public relations, for nature cannot be fooled.
  15. Yes by Ankh · · Score: 4, Informative

    First, the biggest improvement you are likely to see in the Gimp is if you go to Colour->Layers (in older versions of the Gimp it's Layers->Colours->Levels) and click Auto. For pictures that should contain some black and some white this will usually make a noticeable improvement.

    Second, yes, Canon (for example) includes (Windows only, proprietary, secret, closed-source) software to compensate: you shoot a 25% grey surface. You can also use this inside the camera itself: there it will use the data for white balance correction.

    In practice, though, it's fairly hard to do this yourself. One difficulty is that the amount and position of colour aberrationswill probably vary depending on the lens you use, or, with a fixed lens, the amount of zoom and the aperture size. I know I found that when my Casio developed some dark spots.

    There are some programs that are used with hugin, the panorama stitching UI, that help with some lens corrections; it might be you could ask those people. However, a lot of the variation you are seeing is likely to be digital noise. Try taking 3 shots usinga tripod and timer or remote, and comparing them.

    --
    Live barefoot!
    free engravings/woodcuts
  16. Or GREYCstoration by dschl · · Score: 4, Interesting

    GREYCstoration. Ugly name, but does the same job, and is open source. Haven't tried it, but there appear to be several plugins for various open source digicam programs and image editors (bottom of their downloads page).

    --
    Slashdot - the place where you can look like a genius by restating the obvious
  17. Uniform pixel sensitivity by Technician · · Score: 2, Informative

    Pixels are not identical in their dark current and light sensitivity.

    For information on correcting these issues which compound in long exposures, find a good astronomy photographers forum. They discuss taking long exposures of various times with the camera capped to identify bright (high dark current) pixels. They use these corrections in their star shots of the same exposure time to subtract out the brightness caused by high dark current pixels. In bright scenes the same thing can be done to correct for low sensitivity (low bright current) pixels. A way out of focus shot of a white screen with primary color filters or lighthing should be able to give you some good sensor correction factor data. Remember that the errors are temprature sensitive so a full correction may be hard to get.

    --
    The truth shall set you free!
  18. Good thing you don't shoot with film by Overzeetop · · Score: 4, Insightful

    You'd be just devastated if you blew a film image up to the level where you could see the grain.

    Here are two questions for you:

    1) Do you find that you are printing your images at sizes larger than 12x18?

    If you are, then you probably ought to have more pixels (i.e., a better camera). I'm okay with digital pictures down to about 150dpi, others swear that you need 300+. Then again, there are people who swear that $3000 unobtainium coated silver strands wrapped in virgin PTFE and assembled when the planets are in alignement make their music sound better.

    2) Presuming you are actually printing at at least 200dpi, can you really see the difference without a loupe on the final prints? I'm not worried about your monitor, because I'm going to bet that if you have a consumer-level camera, you're not doing photoediting on a 7.1MP monitor.

    You see, if you can't tell, don't worry about it. Let your geek side go and spend more time in the field and less time in the darkroom. Seriously - unless you have significant image problems you can see in your final output, the camera and imaging is good enough. Go take some great pictures, and worry a bit less about having digitally perfect pixels.

    --
    Is it just my observation, or are there way too many stupid people in the world?
    1. Re:Good thing you don't shoot with film by Andy+Dodd · · Score: 2, Informative

      "If you are, then you probably ought to have more pixels (i.e., a better camera). I'm okay with digital pictures down to about 150dpi, others swear that you need 300+. Then again, there are people who swear that $3000 unobtainium coated silver strands wrapped in virgin PTFE and assembled when the planets are in alignement make their music sound better."

      More pixels is not necessarily better. More sensor area is usually more important.

      This is why high-end DSLRs with only 4-5 megapixel resolution deliver better images than 7-8 megapixel consumer cameras - larger sensor elements result in higher signal to noise ratio at the sensor, which means less image noise. Considering the submitter's problem is image noise, a higher resolution camera with the same sensor size is NOT going to help them.

      --
      retrorocket.o not found, launch anyway?
  19. Why do you care for photographs? by dlevitan · · Score: 5, Insightful

    Yes, your $1000 digital camera is not going to have a perfect CCD. There is no such thing as a perfect CCD. And I don't understand why you care unless you're trying to do science work with it. Look at it this way, no one is ever going to look at your picture and say its horrible because one pixel is slightly different than the one next to it. You look at the content of the whole photograph, not three pixels.

    If you are trying to do science, then a DSLR is not what you need. DSLRs use Bayer interpolation to create a color image. This inherently kills your accuracy since not every pixel in the image is actually a pixel on the camera. CCDs used for astronomy (which cost more than your whole camera) do not do this and they still suffer from the effects you mentioned. Every exposure used for scientific work goes through a whole data reduction process that tries to remove as much noise as possible. Others have mentioned most of the process (bias frames, dark frames, and flat fields), but most astronomical CCDs also have an overscan region which is part of the CCD that is not exposed to light and is used to record the thermal noise on the CCD. This changes from exposure to exposure and from temperature to temperature (and yes I am a researcher in astronomy).

    In short, there's no reason for you to care about this, and there's no chance of fixing this completely (CCDs are not digital - they're analog). There's also no way of applying the same solution to every photograph (and CCDs can change over time). Don't worry about pixel-to-pixel variations and just take photographs for their content. If you're really interested in how CCDs work, read the Handbook of CCD Astronomy by Steve Howell. Its a great introduction to CCDs and how to use them for astronomy.

  20. Re:Not only those by YttriumOxide · · Score: 2, Informative

    Paint.NET is really great for those who need a quick and dirty image editor with a lot more power than MSPaint. However be careful - on most systems, it's a SERIOUS resource hog when dealing with large images (such as the 8 megapixel images from my camera). I find Paint.NET is great for anything that fits on my screen without scaling to less than about 50%, but go above that and my poor little work laptop (Dell Latitude D510 - 512MB RAM, 1.73GHz Pentium-M) will choke and die with lots of swap file use. Photoshop (CS) and the GIMP on the other hand hardly run like a dream, but they both deal with large images in a much nicer way.

    I assume the problem is pretty much entirely RAM related and if you throw a decent amount of RAM at it, you'll be able to work with much larger images, but you'll quickly find you do have a very definite threshold and it'd be wise to avoid going above that.

    --
    My book about LSD and Self-Discovery
    Also on facebook as: DroppingAcidDaleBewan
  21. xnview is a nice free alternative to CS2 by humil8d · · Score: 2
  22. Re:"as bright as possible" is useless by fbjon · · Score: 2, Interesting
    Many cameras do this automatically as you say, like my FZ30, for instance. It's called a dark frame, and it simply closes the shutter and takes a dark image right after the actual shot, using the same shutter speed, then subtracts it from the original using some algorithm. This will take out hot spots that are mostly consistent over a short period of time, but won't touch any other noise.

    Replying to TFA:

    surprised (disappointed, since I expect digital perfection) at the variance in adjacent pixels.
    Digital perfection does not exist! You (the submitter) are taking images of the real world, where light moves around somewhat randomly in energy packets called photons, not in perfect rays. Noise can not be eliminated, ever. There's also some noise from the electronic components of the camera itself, which you also have to live with, unless you get a better quality camera. Or use some careful noise reduction. You do have the option of creating digital perfection, though. 3ds Max is popular, I gather. :)


    If color variance is the problem, however, that's due to the CCD design. The CCD in nearly every camera is a single chip for all three colors (4 in some rare cases), but a single photosite ("pixel") can only detect one color. This means the sites need to be mosaiced in a regular pattern, usually RGBG, which is then decoded into a raster image like JPEG. For your 7.1 Mpix camera, than means about 3.5 Mpix resolution for green golors, and 1.8 Mpix for red and blue each. This can cause colored blotches in supposedly even areas, but this kind of noise is fortunately really easy to remove with any decent noise-removal plugin. Perhaps it's possible to avoid this noise in the conversion from the raw data, though?

    Most importantly, inspecting the noise of a camera by oogling at 200% isn't very useful, look at larger areas instead. Most noise disappears when put into its normal scale for viewing.

    To answer the last question in TFS, yes, if there are bad pixels, it's not hard to find them and create a mask or an action (in PS) that eliminates them. You can also take a noise print for your camera at different ISOs/shutter speeds (at least in Neat Image), and store them for later use in other photos, so you don't need to analyze the noise over and over again. Again, if you want less noise to begin with, make sure you're using the lowest ISO setting that gives you a usable shutter speed, or get a camera with larger sensor area, that can capture more photons in the same amount of time. Also remember that some noise is good noise. A noiseless picture tends to look a bit unnatural, so don't try to remove all of it.

    --
    True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.