Windows dead pixel on camera, photoshop help please

Discussion in 'Software' started by Mister_Tad, 18 Jan 2004.

  1. Mister_Tad

    Mister_Tad Will work for nuts Super Moderator

    Joined:
    27 Dec 2002
    Posts:
    13,447
    Likes Received:
    1,677
    i was gutted the other day when i noticed that all of my pictures i had taken in the last couple days have a nice green pixel, just about in the middle

    instead of sending my camera off for ages and paying through the nose for a reapair i was wondering if in either photoshop 7 or paint shop pro 8, could i batch process a bunch of photos to get rid of the pixel and then interpolate it based on surrounding pixels?
    the pixel is always in the same place and i can do it myself obviously but i dont fancy doing it to 100+ photos at a time

    so then, is it possible for me to make a filter which would sort it out regardless of what the picture is? and if so, how shall i go about it?
     
  2. Hargle

    Hargle What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    404
    Likes Received:
    1
    If you can't figure out how to do it in an photoshop/PSP I would of thought you would be able to write your own program to do this. As long as you have an image loading library that supports the format the images are stored in, the code should take a few minutes. You could do it in Java (which I know you know), but I would say C was more fitting; in which case DirectShow (part of DirectX) should load any kind of image you throw at it.
     
  3. Mister_Tad

    Mister_Tad Will work for nuts Super Moderator

    Joined:
    27 Dec 2002
    Posts:
    13,447
    Likes Received:
    1,677
    i had thought of a more DIY approach to it but i figured photoshop would be a lot less painful a way of doing it
    but i suppose you do hav a point, it isn't especially difficult at all and would probably easier to do that, i'll have a play this afternoon (after ADS exam, insomnia + 9am exam = disaster :sigh: )
     
  4. Hargle

    Hargle What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    404
    Likes Received:
    1
    Yeah I finally managed to get back to a semi-normal sleeping pattern over the weekend, but had to sacrifice doing any revision to do so, hehe. The exam was average though I suppose, certainly could have been better.

    Computer Graphics exam 9am tomorrow, I can hardly wait...
     
  5. Mister_Tad

    Mister_Tad Will work for nuts Super Moderator

    Joined:
    27 Dec 2002
    Posts:
    13,447
    Likes Received:
    1,677
    nice, i have heard such lovely things about that module, pity i dont do it :D
    that ADS exam was a bit harsh, I probably just did *ok*, just wrote down everything that may have pertained to a question if i didnt know the answer and hope that i picked up marks for something :clap:


    seeing as im not doing the computer graphics module nor did i do the image processing module last year, not quite sure where to start with this
    any chance you could point me in the right direction as to what classes/methods i should be looking at before i start dredging blindly through the API? i'll use java, seeing as i haven't properly used C++ since 1997
     
  6. Atomic

    Atomic Gerwaff

    Joined:
    6 May 2002
    Posts:
    9,646
    Likes Received:
    94
    Would it not be easier just to use the same colour of the pixel to the left (or right) of the dead one?

    Also what about different sized photos?
     
  7. Mister_Tad

    Mister_Tad Will work for nuts Super Moderator

    Joined:
    27 Dec 2002
    Posts:
    13,447
    Likes Received:
    1,677
    some photos look a bit strange if it is done like that :sigh:, so i was trying to get an average of all of the pixels around it
    it probably isn't especially noticeable like that but *I* can tell and that is what bugs me, even when printed out 4x6 you can tell on some of them

    i take all of my pictures at the same size so that isnt much of a problem about different sizes
     
  8. Hargle

    Hargle What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    404
    Likes Received:
    1
    Not sure what format your images are in, but I'm going to guess JPEG.

    There's a class that wraps the Java JPEG loading library that Steve Mills wrote for the Image Processing module. It seems to be designed with simplicity in mind (being for an introductory module), so I recommend you check the code out and just use it to get a feel for the API (even if you just use that code you might want to modify the value that dictates the quality of saved JPEGs).

    To calculate the value for the new pixel you have a number of options, and you might want to code them all; they're only a few lines each.

    You could just pick a value from around the pixel as already suggested, pick the median, mean or mode of the surrounding pixels, etc.

    The class linked above takes x and y values for getting and setting pixel values so you don't have to work out the arrary indexes. Shouldn't be too hard.
     
  9. Mister_Tad

    Mister_Tad Will work for nuts Super Moderator

    Joined:
    27 Dec 2002
    Posts:
    13,447
    Likes Received:
    1,677
    cheers for that mate
    even if it is from steve "can't pronounce database correctly" mills :D

    ill have a look at that and try to get a feel for it
    the pics are indeed in JPEG, not 100% positive on the compression ratio but they are about as lossless as you can get while still maintaining a 2-3MB file size per photo
     
Tags:

Share This Page