4 Replies Latest reply: Jan 31, 2014 10:50 PM by Herbert2001 RSS

    Rotating object sampling quality issues

    Herbert2001 Community Member

      A student of mine asked this question today. Rotating sharp-edged artwork seems to be problematic in Photoshop.

       

      Take this grid:

       

      t1.png

      Original file (6 colours):

      www.estructor.biz/testje/grid2.png

      Now rotate by 45 degrees.

       

      These are the results in Photoshop CS6 labeled by sampling method:

      www.estructor.biz/testje/ps_grid.png

       

      And these are the results in Photoline (latest beta introduced improved two new sampling algorithms):

      www.estructor.biz/testje/pl_grid.png

       

      I uploaded the raw png files to my own server, otherwise the quality may be affected by the upload function here.

       

      To compare both, open them in Photoshop and zoom to 200% or 400%, and notice how Photoshop's versions do not compare favourably: some sort of unsharp mask sharpening effect was introduced, resulting in halos.

       

      The CatmullRom version generated in Photoline seems to be the best one, though the ones with MitchellNetravali, Lanczos3 and even bicubic all arguably produced better anti-aliased versions than the ones in Photoshop. In Photoshop only Bicubic Smooth is acceptable (in my opinion), though the anti-aliasing is too smooth looking.

       

      I am aware the effects can be subtle - though they are quite noticeable. I mean, why does Photoshop's bicubic sampling prodube such an inferior version compared to Photoline? It makes no sense.

       

      A secondary observation I made is that Photoshop's version introduced 2271 colours into the rotated version, while Photoline only used 231 unique colours after transformation. Which, with Photoline's version being the superior one, exacerbates the problem in my view, because it will add to the final artwork's file size (may be very important for both web graphics and 2d game graphics).

       

      From a user experience view point, another issue is that Photoshop CS6 will not render the final result as a preview before the actual transformation is applied - meaning the user is left to first apply the transformation, and then she/he is forced to undo, and redo until satisfied. In Photoline, for example, the transformation's sampling method can be changed and the actual result is shown before committing to a sampling method.

       

      All this is not that important to me for my own personal work, because I switched to Photoline and other software more than a year ago. However, I do still want to be able to answer questions from students in regards to Photoshop, so I feel it is an important aspect.

       

      So, my (and my students') questions are:

       

      - is it possible to turn off that unsharp mask-like effect when rotating?

       

      - are there ways to improve the sampling somehow?

       

      - down-sampling sharp artwork also introduces similar problems. Any way to circumvent them?

       

      - placing the grid/dragging the grid file into a photoshop file produces a terrible result. Only by opening the grid file first, and copying and pasting is the original artwork preserved. Drag and drop does not function properly (and refuses to place at 100% automatically). Any solutions to change the drag and drop behaviour to automatically resample?

      (btw, this does not happen in Photoline either - drag and drop does not (and should not!) resample in this case!)

       

      - have these issues been resolved in Photoshop CC latest version?

       

      - if the current versions of CS6 or CC do not offer solutions for this type of work, is this something that will be fixed in an upcoming release? Or is it not at all on the radar?

       

      Thanks.

       

      ---------

      ps As mentioned before in the Illustrator forum, exporting sharp artwork from Illustrator at low screen resolutions is by far the lesser of a viable option - the anti-aliasing is absolutely horrid, unless the artwork is directly imported into Photoshop and severely blown up, and then scaled down. And even then the results are not on par with Mitchel-Netravali and Catmul Rom.

        • 1. Re: Rotating object sampling quality issues
          SG... Employee Hosts

          Hi,

           

          I realize this doesn't answer all your questions, but does changing this preference get you farther along?

          http://blogs.adobe.com/jkost/2012/05/align-to-pixel-grid-in-photoshop-cs6.html

           

          regards,

          steve

           

          Ps. Here's quick tip for pixel perfect alignment in pre-Ps CS6 versions: https://coderwall.com/p/g_mtea

          • 2. Re: Rotating object sampling quality issues
            Mike Gondek Community Member

            You are working with only 387 x 357 pixels, and that is a major part of the problem. Think of every pixel being a 3" tile, and you are on an island and trying to spell WILSON. With only 357 stones, you will see some stairstepping on angles (eg: letters WASN), double that amount and you will get a better looking angled lines.

             

            To get better quality, draw your item in illustrator, and then use Ilustrator save for web. If you need to merge this with some work in Photoshop, then place this as a smart object in Photoshop, as if this was bitmmaped each transofrmation would degrade your final image.

             

            You have alraedy done a good job researching the interpolation so choose the mthod you like best.

             

            To get rid of the gaussian blue like effect, you may have to try .gif, but then your angled lines will look more stairsteepd, but explore the tradeoff.

            • 3. Re: Rotating object sampling quality issues
              Chris Cox Adobe Employee

              Lanczos usuually has ringing artifacts, and Catmull-Rom is known to be soft.

              Just because you can implement an interpolation kernel, doesn't mean it's good enough to ship.

              • 4. Re: Rotating object sampling quality issues
                Herbert2001 Community Member

                @Steve: thanks, but I am quite experienced, and I did not import the vector itself, but a straightforward bitmap grid to avoid any interpolation while importing and converting the vector graphic itself. Also see the first paragraph in my response to Mike below .

                 

                -----

                 

                @Mike: importing the grid as a smart illustrator object does indeed help - but the lines are too thick and dark looking compared to Mitchell-Netravali and Catmull-Rom.

                 

                Exporting your screen sized artwork from Illustrator using the save for web option is positively the worst option: the quality is unacceptable in most cases. I've done a small write up concerning the bad anti-aliasing as a result of Illustrator's web export here:

                http://forums.adobe.com/message/6002543#6002543

                 

                The only workable solution to get the best anti-aliased down-scaled artwork from Illustrator is to blow up the artwork to a large size, then rasterize, and scale down again. Even then the final quality as a result of the built-in sampling algorithms of Photoshop will not be on par with Photoline or ImageMagick.

                 

                And, of course, not always is a vector version available. The screen artwork I receive is often bitmap based, which proves to be problematic for transformation jobs in Photoshop.

                 

                Gif is merely 8bit indexed, and would not solve the issue - reducing the number of colours is no solution for poor anti-aliasing along edges.

                 

                -----

                 

                @Chris: I am unsure how you can say that - yes, Catmull-Rom is known to be a less than ideal re-sampling method for up-scaling images. That said, it works wonderfully well for down-sampling images or as a sampling method to transform lower resolution bitmap based artwork - essential for screen based work and web jobs.

                 

                Lanczos does a meagre job for down-sampling (with Lanczos8 especially bad in terms of artifacts), but a very good job for up-sampling images. We have to know the goal to identify the best method/approach/solution.

                 

                Although I am certain you are familiar with the math, the example shown on this page demonstrates that Catmull-Rom and Mitchell-Netravali do in fact work best for down-sampling images: http://pixinsight.com/doc/docs/InterpolationAlgorithms/InterpolationAlgorithms.html

                 

                And I am not inventing all this - for lower resolution sharp edged illustrative artwork Photoshop has always been rather awkward. The sampling methods currently implemented in Photoshop deal very well with high resolution artwork and photographic media, but fare poorly with lower resolution graphics.

                 

                The demonstration files I prepared earlier and linked in my original question show unequivocally that Photoshop's current sampling algorithms deal poorly in this regard! I did not even bother to include Bicubic Automatic, because that looked positively awful.

                 

                I do understand why that is - traditionally it has never been Photoshop's focus I think. Looking at the bare-bones results, though, I am inclined to conclude that both Mitchell-Netravali and Catmull-Rom do indeed produce superior results for down-sampling and re-sampling during transformations of lower resolution images - both sharp-edged artwork, as well as photos.

                 

                This has been my experience for years now dealing with 2d game graphics, web work, and general screen graphics work. It is one of the reasons why I left Photoshop and Illustrator early on for this type of work.

                 

                So it eludes me why these are not available in Photoshop. Because as far as the results are concerned, they seem to be quite good enough to ship.