3 Replies Latest reply: Nov 12, 2011 1:05 AM by miguelmenendez RSS

    rgb in jpeg makes differences from rgb in css?


      Hi all


      I take the a rgb color from the original image (it was in pdf):




      I made a jpg using this rgb as background color.


      I also use a css command

      body { background-color: rgb(26,23,27); }


      I put my image in the html page with that background and on screen you can notice differences between body background and image background..


      Are there any solutions?





        • 1. Re: rgb in jpeg makes differences from rgb in css?
          gator soup Community Member

          it is going to make a difference which browser you are testing, you know, it might also be useful to include a screenshot of the difference, or better a link to your page


          i haven't experimented much with css colormanagement, but for a solution,  you may want to try Converting the image to sRGB, stripping the profile from the image and not specifying a css profile in html/css -- if you are trying to blend a pixel image into a html background (that way the same profile will be used on both elements)


          if you do get it to work, I would be interested in how you did it...

          • 2. Re: rgb in jpeg makes differences from rgb in css?
            Gusgsm Community Member

            Ciao, Roberto


            Any uncalibrated RGB is device dependent —that is: It's appearance will change depending on the device representing those numbers—. Raw RGB numbers are uncalibrated unless used under the umbrella of a colour profile.


            Your best bet is, as gator soup points, to put both sets of numbers —picture colours and css values— in the same park so that even if they are missinterpreted by any piece of software, they will be missinterpreted  exactly in the same way, so that you won't see any difference between same sets of values.


            And sRGB is a good (best?) profile to work as a basis for colours in web images and pages. So, all raw RGB saved and worked under it will be driven, at least, into the same set.


            Hope it helps.



            • 3. Re: rgb in jpeg makes differences from rgb in css?
              miguelmenendez Community Member

              The correct way to get especific color in browsers is convert the colors to hexadecimal and the photos to sRGB through photoshop and the convert to web and devices, there you will see that convert to srgb  is enabled by default.