Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Scaling Algorithm Bug In Gimp, Photoshop, Others

  1. #1

    Join Date
    Sep 2003
    Location
    Massachusetts USA
    Posts
    7,833

    Scaling Algorithm Bug In Gimp, Photoshop, Others

    See http://www.4p8.com/eric.brasseur/gamma.html

    "Photographs that have been scaled with these software have been degradated. The degradation is often faint but probably most pictures contain at least an array where the degradation is clearly visible. I suppose this happens since the first versions of these software, maybe 20 years ago....

    Photoshop
    It seems Photoshop CS3 operates on the images properly if they are expressed in 32 bit format. So you just have to convert an image to 32 bit before making operations like scaling on it. It is not known wether other versions than CS3 operate correctly in 32 bit format. When the image is expressed in 8 bit, version CS3 operates incorrectly. It is not either known wether Photoshop CS3 expresses 32 bit images in linear format or the scaling routine performs the necessary gamma conversions when scaling 32 bit images.

    One drawback is some tools are not yet available for 32 bit encoded images, like bicubic resampling. Next procedure is more complicated but it should allow to work around. The only downside would be some rounding errors (probably not visible) as a result of converting to a linear gamma and back again:

    1. Convert to 16 bit/channel mode to minimize rounding errors (optional).
    2. Go to "Convert to profile" (in CS3, this is under the Edit menu).
    3. Select the current profile for the destination space (so that both the source and destination space are referencing the same color space) *but do not hit OK*. If your document is not yet color managed, sRGB is probably the safest guess. This will pre-populate most of the fields for the next step...
    4. Select "Custom RGB" for the destination space. You will get a pop-up window asking for the parameters for your custom color space.
    5. In the options for setting up a custom color space, leave everything unchanged except set the gamma to 1.0.
    6. Press OK in the Custom RGB dialog box and then press OK on the Convert to Profile dialog box.
    7. Resize as normal.
    8. Convert to your previous color space.
    9. If you converted to 16bit/channel mode, you may want to convert back to 8bit/channel at this point."


    I tested his test image in CS3 on a Mac, and as predicted, it scales quite badly - unless you convert to 32-bit first. That might be a slow and expensive operation on larger images, since it doubles the size of a 16-bit file, and quadruples the size of an 8-bit file. It's ironic that you have to up-size before you can down-size, as it were.

    Dunno how vital this really is, but if you like to understand the underlying algorithm, it's... interesting.

    English spelling is very hard, I admit, but the word degredated sounds cute to a native English speaker.

  2. #2
    hacker extraordinaire
    Join Date
    May 2009
    Location
    North Carolina
    Posts
    1,329

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    I have always had a hunch, but never really a solidified opinion that digital imaging tools were so flawed and weak in their implementations and integrity. But everything I read technical about colorspaces, management, and image manipulation algorithms reinforces my hunch that it's all made by engineers that aren't artists, and used by artists that aren't engineers. They always used to say that it was better to know as little as possible about the way laws and sausages are made. Maybe that should be extended to digital image manipulation programs.

  3. #3
    Resident Heretic Bruce Watson's Avatar
    Join Date
    Sep 2003
    Location
    USA, North Carolina
    Posts
    3,159

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    So... what's the visual effect we're talking about here? Are there any posted examples to look at?

    Edit: Ah, this is the old linear vs. gamma space argument that's been hanging around since the beginning of computer image editing. Not that big a deal. Maybe we'll eventually end up with enough standards that we can make a reasonable fix for this some day. Until then, almost everyone will continue to ignore it -- SOP.

    Bruce Watson

  4. #4

    Join Date
    Dec 1997
    Location
    Baraboo, Wisconsin
    Posts
    7,695

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    Quote Originally Posted by BetterSense View Post
    I have always had a hunch, but never really a solidified opinion that digital imaging tools were so flawed and weak in their implementations and integrity. But everything I read technical about colorspaces, management, and image manipulation algorithms reinforces my hunch that it's all made by engineers that aren't artists, and used by artists that aren't engineers. They always used to say that it was better to know as little as possible about the way laws and sausages are made. Maybe that should be extended to digital image manipulation programs.
    Which version of Photoshop are you using that leads you to think this?
    Brian Ellis
    Before you criticize someone, walk a mile in their shoes. That way when you do criticize them you'll be
    a mile away and you'll have their shoes.

  5. #5
    Kirk Gittings's Avatar
    Join Date
    Mar 2004
    Location
    Albuquerque, Nuevo Mexico
    Posts
    9,718

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    And provided the images are first translated in 32 bit depth encoding (or just 16 bit), these software do the computations correctly too: CS3 and CS4.
    Doesn't seem like a big deal. If you are working in 16 bit, which any serious worker should be, then according to this article, this is not an issue. What am I missing?
    Thanks,
    Kirk

    at age 67
    "The woods are lovely, dark and deep,
    But I have promises to keep,
    And miles to go before I sleep,
    And miles to go before I sleep"

  6. #6

    Join Date
    Dec 2005
    Location
    Southern California
    Posts
    2,721

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    Quote Originally Posted by BetterSense View Post
    I have always had a hunch, but never really a solidified opinion that digital imaging tools were so flawed and weak in their implementations and integrity. But everything I read technical about colorspaces, management, and image manipulation algorithms reinforces my hunch that it's all made by engineers that aren't artists, and used by artists that aren't engineers. They always used to say that it was better to know as little as possible about the way laws and sausages are made. Maybe that should be extended to digital image manipulation programs.
    Would you rather drive a car made by an artist or the one made by an engineer?

  7. #7

    Join Date
    Dec 2006
    Posts
    951

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    Kind of tangential to large format, Ken.

  8. #8

    Join Date
    Oct 2003
    Location
    Ottawa, Canada
    Posts
    638

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    I've had several incidents where downsizing had quite unexpected effects, typically a form of grain aliasing, though a few cases where textures went odd and should not have. I wouldn't call it irrelevant.

  9. #9

    Join Date
    Sep 2003
    Location
    Massachusetts USA
    Posts
    7,833

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    "Kind of tangential to large format, Ken."

    I posted it in the Digital Processing section, so hopefully it won't distract members who focus exclusively on analog processes.

    Since some of us scan our Large Format images, the issue of up-sizing and down-sizing can be rather central - especially if it doesn't work as advertised.

    "If you are working in 16 bit, which any serious worker should be, then according to this article, this is not an issue. What am I missing?"

    The article suggests that working in 16-bit will not guarantee a proper scaling. When I tested the sample image, it failed as predicted. One must convert to 32-bit, then scale, then convert back again.

    What remains to be seen, is whether the effect is noticeable. It has certainly escaped the attention of keen observers, like many of us

    I remember when Intel had to recall a lot of Pentium processors, after discovery that under certain rare conditions, arithmetic operations resulted in wrong answers - but this is even more subtle. Hopefully, the software vendors will correct the problem.

    Meanwhile, I had a look at Acorn, one of the programs which doesn't suffer from that bug. It looks promising.

  10. #10

    Join Date
    Oct 2003
    Location
    Ottawa, Canada
    Posts
    638

    Re: Scaling Algorithm Bug In Gimp, Photoshop, Others

    I think bicubic scaling should make a difference, though I'd have to experiment. It seems right to the mathy in me.

Similar Threads

  1. 8X20 envy...
    By jim kitchen in forum Digital Processing
    Replies: 17
    Last Post: 17-Aug-2008, 19:58
  2. Photoshop with black and white
    By Eric Brody in forum Digital Processing
    Replies: 20
    Last Post: 31-Jan-2007, 02:04
  3. Photoshop, Metering, and Smokies workshops for 2007
    By Danny Burk in forum Announcements
    Replies: 0
    Last Post: 28-Nov-2006, 16:19
  4. Do you really NEED Photoshop?
    By Ed Eubanks in forum Digital Hardware
    Replies: 29
    Last Post: 12-Oct-2004, 10:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •