14 Replies Latest reply on May 28, 2014 4:31 PM by Trevor.Dennis

    Is it possible to Transform (stretch) a picture in a logarithmic way?

    Michel1902 Level 1

      In Architectural photography, once we have corrected the perspective and the parallax, (when the building image is fully orthogonal), the windows on the higher floors remain smaller than the ones on ground floor (assuming a photograph taken from the ground floor). This phenomenon is more noticeable when the building is taller. Is there a way to 'transform' or stretch the image, such that all the windows are made to be of equal height at every floor level? (assuming that the subject windows are all identical)


      This point of view is ruled by a simple mathematical function, such as a logarithm or an asymptote. The Transform tool is linear. I imagine it would be easy to adapt Photoshop to achieve this, if it doesn't already exist.


      In my photographs, I need to replicate the details of façades as closely to an architectural elevation drawing as possible.

      Can someone please help me figuring this out?

      Thanks,

       

      Michel CARON (michel1902)

      Toronto 

        • 2. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
          Michel1902 Level 1

          Hi JJMack,

          I just reviewed the tutorial on line for Perspective Warp and I am sure it is linear as well. Wonderful new product, but not exactly what I'm looking for. It is fundamentally about handling perspective, not elevations, although one does not exclude the other.

           

          Also the example they use is only 3 storeys, so the difference in height between GF and floor 3 is not really perceptible. If what I call 'logarithmic transformation' had been an option, they would have made it clear and made it one of the important points.

           

          I'm still searching... But thanks,

          Michel

          • 3. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
            Trevor.Dennis Adobe Community Professional

            Try this, and I have just this moment dreamed it up, so it may or may not work.

             

            Open you image, copy the BG layer and select all.

            Go into Quick mask mode, and run a black to white gradient across the image.

            Come out of quick mask, and save the selection.

            Extend the Canvas size.

            Load the Selection you just saved, and use Free Transform to stretch the layer.

             

            You could also try a variation of this using the same saved selection as a Protect with Content Aware Scale.

             

            I am just heading out, so don't have time to test it, but I will be doing so when I get back.

            • 4. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
              Level 7

              That is a perspective transform, not logarithmic.  And Photoshop has several methods available to do perspective transforms or corrections.

              • 5. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                Trevor.Dennis Adobe Community Professional

                This is what I got after ten minutes experimenting.  The lower blocks are the control, and what I started with.

                Log Transform.jpg

                Free Transform was a non starter, as anything less than 100% opaque simply blurs to translucency as it is stretched.  Content Aware Scale is better, but the trick is to work out the gradient values.  Full black to full white is no good, as the blocks at the thin end of the gradient are not affected at all.  The above was done using black to 50% grey, but you can see nothing happens until the sixth block, so black to something darker than 50% grey would work better.

                 

                OK, so the procedure was:

                • Enter Quick Mask
                • Lay a gradient across the canvas from black to something like 175,175,175
                • Come out of Quick Mask and save the selection
                • Note: the layer you are going to stretch must be solid.  I originally had transparency between the black blocks and it all wen t very weird on me.
                • Increase canvas size to one side to give you room to stretch the layer into.
                • Select the target layer, and Ctrl (Cmd) click it to load it as a selection.
                • Go Edit > Content Aware Scale, and from the Options bar, choose the selection you saved from Protect.
                • Drag into your stretched canvas area.  If results are not what you wanted, create a new saved gradient selection using a different value for the lighter end.

                This is obviously rough and ready, and I have no idea how you'd do it with a mathematically correct log scale.

                • 6. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                  D Fosse Adobe Community Professional & MVP

                  Ummm, this is interesting. I've been looking for logarithmic transform myself on occasion (but for other reasons than the OP).

                   

                  Still not sure what Trevor is up to, I don't like the idea of mixing Content Aware into it, that's introducing a random element. Keep at it guys, come up with something brilliant .

                   

                  If there's a feature request at the end of this, I'm in.

                  • 7. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                    Level 1

                    there is one plugin called http://www.alienskin.com/blowup by using that plugin we can resize image (smaller to bigger, bigger to smallar& stretchable) with out losing quality but i am not sure of 100% quality...but its better it may help for u....

                    • 8. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                      Trevor.Dennis Adobe Community Professional

                      Atiqur Sumon wrote:

                       

                      there is one plugin called http://www.alienskin.com/blowup by using that plugin we can resize image (smaller to bigger, bigger to smallar& stretchable) with out losing quality but i am not sure of 100% quality...but its better it may help for u....

                       

                      That is bizarre, even by your standards.  How, exactly, is it remotely relevant, in even the tiniest way, to this thread?

                      • 9. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                        Trevor.Dennis Adobe Community Professional

                        twenty_one wrote:

                         

                        Ummm, this is interesting. I've been looking for logarithmic transform myself on occasion (but for other reasons than the OP).

                         

                        Still not sure what Trevor is up to, I don't like the idea of mixing Content Aware into it, that's introducing a random element. Keep at it guys, come up with something brilliant .

                         

                        If there's a feature request at the end of this, I'm in.

                        The CAS trick turned out to be not particularly useful Dag, because a further play with the gradient values going through stages of black to 175,175,175, and 200,200,200 and finally 240,240,240 all produced identical results to my example above which used black to 50% grey, so it appears that the Protect feature in CAS is not infinitely adjustable.  That makes it kind of useless I guess.

                         

                        However, having gone that far, I did measure the block size progression, which turned out to be:

                        Block Sizes.jpg

                        And using those values to produce a simple Excel graph:

                        CAS Progression.JPG

                         

                        Is that logarithmic?  (I suspect the little blip at the bottom end will be because of the arbitrary number of blocks I started with, and now I look at it, I should have measured the block plus the preceding gap.)

                         

                        So while my Content Aware Scale idea was not entirely successful, what you could do is extend the canvas by about 35% in the opposite direction before making your Quick Select gradient.  This is because the size progression stops about the 65% point, so if you artificially add the extra canvas and include it in your Quick Select gradient, you are kind of tricking CAS to progressively stretch your actual image. It's coming up to 1am here, so I'll give it a go in the morning, and make a better job of my measurements.

                        • 10. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                          Dsarchy Level 3

                          Could you not use the spherize filter. I read up on a similar idea where you stretch the image to the width you desire, double the canvas size (width) aligned right. Run the distort>spherize and set it to horizontal only and set the value to something like -70. After cropping you should have a gradient that gets larger as it progresses.

                          • 11. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                            D Fosse Adobe Community Professional & MVP

                            Trevor Dennis wrote:

                             

                            That is bizarre, even by your standards.  How, exactly, is it remotely relevant, in even the tiniest way, to this thread?

                            And now he's "following" me, even. What do I do with that?

                             

                            I'm getting fed up with this. I refreshed my thread in Forum Comments, I really want someone to put a stop to this.

                            • 12. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                              Michel1902 Level 1

                              Thanks Dsarchy, Trevor Dennis and others for trying to find a solution to this.

                              I think I'm pretty close.

                               

                              I find that the Spherize filter >vertical / horizontal, in combination with Perspective Warp, allow me to approximate best what I need to do.

                               

                              A fundamental factor is the lens I use, Nikon's 24mm tilt-shift PC, which already compensates optically to some degree. (By viewing at an angle through the edge of the lens instead of through its central axis, we see that the image gets gradually more stretched as it gets closer to the edge of the lens.)


                              So with these three complementary tools and equipment I get the effect I was looking for, although it remains a craft and not a straightforward mathematical solution.


                              Now all I have to do is practice, and my initial testing is quite satisfactory, thanks to all.


                              Michel CARON,

                              Toronto

                              • 13. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                                Chuck Uebele Adobe Community Professional & MVP

                                I too have wanted a feature that does this.  It would be ideal to have a feature added to the scale, where you could specify the amount one end of the transform box get "sized" vs the other end. 

                                • 14. Re: Is it possible to Transform (stretch) a picture in a logarithmic way?
                                  Trevor.Dennis Adobe Community Professional

                                  Dsarchy wrote:

                                   

                                  Could you not use the spherize filter. I read up on a similar idea where you stretch the image to the width you desire, double the canvas size (width) aligned right. Run the distort>spherize and set it to horizontal only and set the value to something like -70. After cropping you should have a gradient that gets larger as it progresses.

                                  Hey, that's a cool idea, and it sounds like it worked OK from what Michel says in post #12.

                                   

                                  Having a better idea now, from that post, what Michel is trying to achieve, I am wondering what the lens profiles in ACR would do?  Hmm I just looked and there are no TS/E profiles. What about DXO Optics, or PTLens?

                                   

                                  But do you know who I would love to get involved in this discussion?  The mad scientist, looney tunes genius, Russell Brown.  I've seen him do amazing left field things with Adaptive Wide Angle with his spherical panoramas taken with his little Phantom quad-copter, for instance.  I just know he would come up with a solution as brilliant as it was unexpected.