Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The color swap accident...

The color swap accident...

Scheduled Pinned Locked Moved The Lounge
graphicsquestionphpwinformscom
20 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Jan R Hansen

    OK, so my parents-in-law have been to Corsica (fourth largest island in the Mediterranean Sea, according to wikipedia - lovely place according to my parents in law) for a 5 day hiking holiday. They went with some of their friends, who took a lot of photos with a Canon Digital Ixus 70 (aka Canon Powershot SD1000 outside europe). Unfortunately, the camera was in Color swap mode, which (according to http://www.photographyblog.com/reviews_canon_digital_ixus_70.php[^]) is this: "...whilst Color Swap lets you select a colour in the image and change it for another completely different one. " Whatever the setting is good for, it has turned all the pictures from their holiday into useless cr** and we need some help. I figure that given the description and given my imagination, the process of reversing a color swap is re-arranging the values of the rgb channels in the image somehow. I've searched CP (and found a nice GDI+ article from Christian, but it didn't help me enough), tried google, asked the graphics designer I work with - but I'm lost. It has to be possible, but how? If anybody has a good idea, a macro or instructions for adobe creative suite 2 or 3 or some code that can do something like this, we would greatly appreciate a helping hand :) If it can help in any way, I've put a sample picture here: corsicasample.jpg[^] - my mother in law is wearing a t-shirt that has the same color as the green in this smiley: :~ it isn't pink. Neither is her hair :) Comments, suggestions, code (is it ok to reply with code to a non-programming-question?) - everything is welcome. Thanks in advance for any help! /Jan

    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

    R Offline
    R Offline
    Rich Leyshon
    wrote on last edited by
    #10

    Jan R Hansen wrote:

    my mother in law is wearing a t-shirt that has the same color as the green in this smiley: it isn't pink. Neither is her hair

    So does that mean she has geen hair? :) Rich

    J 1 Reply Last reply
    0
    • J Jan R Hansen

      OK, so my parents-in-law have been to Corsica (fourth largest island in the Mediterranean Sea, according to wikipedia - lovely place according to my parents in law) for a 5 day hiking holiday. They went with some of their friends, who took a lot of photos with a Canon Digital Ixus 70 (aka Canon Powershot SD1000 outside europe). Unfortunately, the camera was in Color swap mode, which (according to http://www.photographyblog.com/reviews_canon_digital_ixus_70.php[^]) is this: "...whilst Color Swap lets you select a colour in the image and change it for another completely different one. " Whatever the setting is good for, it has turned all the pictures from their holiday into useless cr** and we need some help. I figure that given the description and given my imagination, the process of reversing a color swap is re-arranging the values of the rgb channels in the image somehow. I've searched CP (and found a nice GDI+ article from Christian, but it didn't help me enough), tried google, asked the graphics designer I work with - but I'm lost. It has to be possible, but how? If anybody has a good idea, a macro or instructions for adobe creative suite 2 or 3 or some code that can do something like this, we would greatly appreciate a helping hand :) If it can help in any way, I've put a sample picture here: corsicasample.jpg[^] - my mother in law is wearing a t-shirt that has the same color as the green in this smiley: :~ it isn't pink. Neither is her hair :) Comments, suggestions, code (is it ok to reply with code to a non-programming-question?) - everything is welcome. Thanks in advance for any help! /Jan

      Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

      S Offline
      S Offline
      Sebastian Schneider
      wrote on last edited by
      #11

      Convert the images to grayscale, which should correct most obivous color replacements, then recolor with software. I've seen that done to b/w photos, so it should be possible with grayscaled images as well. Could take a while, though....

      Cheers, Sebastian -- "If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton

      1 Reply Last reply
      0
      • A Anthony Mushrow

        Ok, take a look at this http://img174.imageshack.us/img174/8440/testlq0.jpg[^] That was selecting the pinkish colour with variance of 100, hue +80, saturation -60 in photoshop. It may be possible to reproduce this in code but it could be diffucult and you could end up swapping the wrong colours etc. The real problem may be that if it swapped blue with green, but left green alone - you would not be able to set all the green back to blue because that would affect areas that where meant to be green in the first place. If you don't can't/can't be bothered to edit the pics manually, then I wouldn't mind helping out. I have alot of free time between now and the end of July EDIT: After thinking about it a bit more, in that image it seems as though the grays have been replaced - which is good because you should just be able to desaturate the affected areas without messing up the colour too much, this may turn out OK.

        My current favourite word is: I'm starting to run out of fav. words!

        -SK Genius

        Game Programming articles start -here[^]-

        modified on Wednesday, June 11, 2008 7:02 PM

        J Offline
        J Offline
        Jan R Hansen
        wrote on last edited by
        #12

        Thank you for the good advice. As you suggest, they may have replaced x with y, leaving more y in the picture than originally and thereby leaving us with a photo where the changes are irreversible. I'll try and contact Canon and see if they can help. If you have enough free time and feel like trying, you could record the actions as a macro in photoshop, and I could process the remaining images. I sense that you sort of know what you're doing in photoshop - I don't :-D Thanks for your help so far! /Jan

        Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

        1 Reply Last reply
        0
        • C Christian Graus

          Problem is, if they just swapped red, green and blue channels around, fixing it is really easy. Just take one of my image processing articles as a template, and for each pixel, swap the values around. The values are stored b/g/r inside a windows bitmap, not r/g/b. If they have mapped to completely different colors, then you're going to have to work out the mapping and things become more complex. You need to work out the rules used to change colors, and write code to reverse them.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          J Offline
          J Offline
          Jan R Hansen
          wrote on last edited by
          #13

          yeah... sort of the answer I expected but hoped not to get :-D Do you think it looks like a simple channel swap? It will take me some time to get it reversed - but I'll learn something along the way of course - but I don't want to try if it looks like a dead end to someone more image-minded than me. Thanks for your help and suggestions so far, Christian. /Jan

          Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

          1 Reply Last reply
          0
          • L Lost User

            The hitch is that colour substitution is not reverseable. If you change all of the green to pink you cannot simply change all the pink back to green because it will include all of the pink in the image, not just the stuff that used to be green. Ultimately you can play around with curves etc. in Photoshop, but the net result is that the images are going to lose something. If I were in your boat I'd convince the parents-in-law of the coolness that is black and white photography and just have 'em all printed that way. :-D Cheers, Drew.

            J Offline
            J Offline
            Jan R Hansen
            wrote on last edited by
            #14

            yeah... as I responeded to SK Genius and Christian, that is what I was hoping didn't happen. Is it easy to make great B/W photos out of the images even with rubbish colors? /Jan

            Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

            L 1 Reply Last reply
            0
            • J Jeremy Tierman

              You can do what the other guys said, but in my book, it may be a better solution to go there again!

              J Offline
              J Offline
              Jan R Hansen
              wrote on last edited by
              #15

              That did come up as a suggestion.. but they probably wont do that :laugh:

              Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

              1 Reply Last reply
              0
              • A Andy Brummer

                I think black and white is probably the way to go. There are some good articles on how to play with the strengths of the conversion of each color channel in photoshop so you can get some really stunning b/w photos out of basic color photos.

                I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                J Offline
                J Offline
                Jan R Hansen
                wrote on last edited by
                #16

                So you agree with Drew above - do you have any good advice on where to find those articles?

                Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

                A 1 Reply Last reply
                0
                • R Rich Leyshon

                  Jan R Hansen wrote:

                  my mother in law is wearing a t-shirt that has the same color as the green in this smiley: it isn't pink. Neither is her hair

                  So does that mean she has geen hair? :) Rich

                  J Offline
                  J Offline
                  Jan R Hansen
                  wrote on last edited by
                  #17

                  nope... :-D

                  Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

                  1 Reply Last reply
                  0
                  • P Phil J Pearson

                    Why not email Canon's tech support for advice? OK - it probably won't get you anywhere but it won't hurt to try.

                    Phil


                    The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.

                    J Offline
                    J Offline
                    Jan R Hansen
                    wrote on last edited by
                    #18

                    Yeah, I'll try that. It might not get me anywhere, but I might get lucky and get to know what "they" have done to the images. /Jan

                    Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

                    1 Reply Last reply
                    0
                    • J Jan R Hansen

                      yeah... as I responeded to SK Genius and Christian, that is what I was hoping didn't happen. Is it easy to make great B/W photos out of the images even with rubbish colors? /Jan

                      Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #19

                      Jan R Hansen wrote:

                      Is it easy to make great B/W photos out of the images even with rubbish colors?

                      Well, in your case it should work out fine since the tonal value of the new colour probably isn't that different from the old one. Something like Picasa or any other photo manager will work fine for converting those pics. Cheers, Drew.

                      1 Reply Last reply
                      0
                      • J Jan R Hansen

                        So you agree with Drew above - do you have any good advice on where to find those articles?

                        Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert

                        A Offline
                        A Offline
                        Andy Brummer
                        wrote on last edited by
                        #20

                        Unfortunately I can't really offer much more then googling photoshop greyscale tutorials. Photoshop offers so many options to play with. Essentially converting to greyscale gives you more freedom to play with the color channels to create more dramatic effects. If you crank the blue sky unrealistically dark in a color photo it looks fake, but in b/w it might just look more dramatic. The way to do that dynamically is to do it with two or more layers, the top one converts to b/w and the others let you play with the colors, contrast and the like.

                        I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups