#1  
Old 19-03-2010, 09:02 AM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,060
Photoshop is full of surprises

Hi Guys,

I've been using Photoshop for a very long while since it ported to win32 platforms in the early 90s. It's a great program but I've always been aware of its limitations when it comes to precisely crop (at the pixel level) and I avoid to do such things.

I've been playing with mosaics a bit lately and I came across an issue that I was able to reproduce and wasn't aware of so I thought I'd post and ask for feedback, see if anyone else noticed it.

The version I was using doing the process is PS CS3. Here's what I did step by step.

1_ I opened a high resolution 16bit RGB tiff. Approx (7000px square).
2_ I selected the crop tool and started adjusting the crop window on the bitmap.
3_ I started rotating the crop window by dragging the handles and resizing it so I could maximize the crop area within the mosaic.
4_ I cropped the picture.

The result was shocking. I looked at the stars and thought wow! I can't remember getting that much drift in my guiding?... Checked the original back quickly and the stars were round.

So what happened? Because the crop area wasn't aligned with the original image some type of skewing occured in the picture. Ever so slightly but noticable. I was able to work around by rotating the whole canvas then crop squarely to the new picture borders.

Looks like the resampling and transformation during oblique cropping is not the same as straight cropping.

Any thoughts?
Reply With Quote
  #2  
Old 19-03-2010, 10:33 AM
Octane's Avatar
Octane (Humayun)
IIS Member #671

Octane is offline
 
Join Date: Dec 2005
Location: Canberra
Posts: 11,159
Marc,

Are you sure you didn't accidentally grab the corner squares and push/pull to induce the perspective distortion?

In fact, I can't recall whether you can do that in the crop mode, but, I'd imagine you would be able to as you're pretty much presented with the same marquee as the transform selection marquee.

H
Reply With Quote
  #3  
Old 19-03-2010, 10:35 AM
rogerg's Avatar
rogerg (Roger)
Registered User

rogerg is offline
 
Join Date: Feb 2006
Location: Perth, Western Australia
Posts: 4,563
Interesting. To be honest I've never used the crop tool! and I've been using PS since v3.0. I am not sure I'd noticed it even

I've always just cropped to selection (Image -> Crop).

When needing fine detail of selecting exact pixels to crop to I first put Guides in place around the image while zoomed in at 300% or whatever, then select the square of the area to crop and then Image -> Crop. If needed I rotate the canvas first.
Reply With Quote
  #4  
Old 19-03-2010, 10:41 AM
Octane's Avatar
Octane (Humayun)
IIS Member #671

Octane is offline
 
Join Date: Dec 2005
Location: Canberra
Posts: 11,159
Roger,

That's exactly how I do it, too. Except, I zoom in a little further to get precise placement of guides.

I'm really very anal when it comes to my 3:2 ratios.

H
Reply With Quote
  #5  
Old 19-03-2010, 01:12 PM
Barrykgerdes
Registered User

Barrykgerdes is offline
 
Join Date: Feb 2007
Location: Beaumont Hills NSW
Posts: 2,900
I have done a lot of cropping, rotating and twisting in photoshop.
I use a number of different processes to achieve results.

If the picture needs to be rotated I first work out the exact angle of rotation (trial and error) then increase the canvas size (Star fields I use black fill). Then do the rotate

Rectangular cropping after rotation seems to work OK without any distortions.

If I want an intellegent crop then to a specific pixel I usually use a different program "TheGimp" that allows reading pixel coords with the mouse. This works very well.

Another way I crop when making landscapes for stellarium that needs the landscape cut into panels of a given Square size is to use the canvas sizing tool and the pixel count method. This with a sequence of left right crops, save and step back gives me perfect pixel accuracy for the panels.

Another problem I have struck when making these landscapes is that some landscape programs do not accurately match for a spherical join.
This is where file menu automate crop and straighten is useful. I can stetch and slew the two faces to match exactly to pixel level with a bit of patience. Distortion is OK for this use but I would not use it for star fields

In general photo shop is very versatile but there are many functions that are much easier to do in other programs particularly cut and paste.

As for assembling a mosaic. That is something I have never tried but I have cut a few photos of star field into panels for a mosaic to display in stellarium at higher resolution than can be done with a single photo.

Barry
Reply With Quote
  #6  
Old 19-03-2010, 03:07 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,060
Quote:
Originally Posted by Octane View Post
Marc,

Are you sure you didn't accidentally grab the corner squares and push/pull to induce the perspective distortion?

In fact, I can't recall whether you can do that in the crop mode, but, I'd imagine you would be able to as you're pretty much presented with the same marquee as the transform selection marquee.

H
You can do this by holding CTRL and dragging an anchor point on a selection window but not on a crop window. So you can't distord a crop.
Reply With Quote
  #7  
Old 19-03-2010, 03:08 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,060
Quote:
Originally Posted by Barrykgerdes View Post
If the picture needs to be rotated I first work out the exact angle of rotation (trial and error) then increase the canvas size (Star fields I use black fill). Then do the rotate

Rectangular cropping after rotation seems to work OK without any distortions.
That's what I did and it works fine yes. I think it's safer to crop this way from now on.
Reply With Quote
  #8  
Old 19-03-2010, 03:58 PM
Octane's Avatar
Octane (Humayun)
IIS Member #671

Octane is offline
 
Join Date: Dec 2005
Location: Canberra
Posts: 11,159
You needn't find the angle of rotation by trial and error.

Use the ruler tool (I) and draw a line, left to right on something that should be level.

Go to Image -> Rotate -> Arbitrary, and it'll have the required angle of adjustment already pre-filled for you. Click OK, and you're done.

H
Reply With Quote
  #9  
Old 19-03-2010, 04:58 PM
Barrykgerdes
Registered User

Barrykgerdes is offline
 
Join Date: Feb 2007
Location: Beaumont Hills NSW
Posts: 2,900
Quote:
Originally Posted by Octane View Post
You needn't find the angle of rotation by trial and error.

Use the ruler tool (I) and draw a line, left to right on something that should be level.

Go to Image -> Rotate -> Arbitrary, and it'll have the required angle of adjustment already pre-filled for you. Click OK, and you're done.

H
Thats what I mean by "trial and error" The problem is just working out what is the actual true base line you wish to work to.

When I prepare a texture to insert into Stellarium it likes to be "up" = North. and its size 256 x256, 512 x 512 or 1024 x1024 pixels. The first thing I do is locate a known star at what I can use as the centre and use its J2000 coords. I place the picture into TheGimp and locate the pixel coords of its centre I can then crop the picture in Photoshop to give me the required size.

Next I put the picture back into TheGimp and get the pixel coords of some other known stars near the edges of the picture.

I then use a program I wrote in QBasic that takes all this information and calculates the coords of the corners of the picture on a spherical surface and writes an insert to place in the textures.json file that will display the picture as an overlay in stellarium.

The program uses a lot of maths to calculate the corner coords to 4 decimal places and saves me quite some time in getting the picture to actually overlay the stars.

We can display pictures from the DSS in stellarium but the feature is not activated at the moment. The DSS textures have the coords of the corners in the header so there is no problem displaying them. That is why we use the "json" system.

Barry
Reply With Quote
  #10  
Old 21-03-2010, 09:33 AM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,060
In my case I find it easier to approximate the maximum usable surface of a mosaic by rotating/scaling a rectangular window over the original picture rather than rotating the whole canvas and cutting by trial and error.

The interpolation/resampling problem occurs when I do crop the selection in place and it's rotated. So here's what I do now.

1_ create a small rectangle shape in another layer on top of the original.
2_ Set the opacity to 50% and color to bright red.
3_ scale/rotate the shape to maximize the area over the original.
4_ apply the transform to the shape.
5_ rotate the whole canvas of the original and the shape layer to match the orientation of the workspace.
6_ crop in place when everything is square without rotating.

Seems to work better.

Last edited by multiweb; 21-03-2010 at 10:02 AM. Reason: spelling
Reply With Quote
Reply

Bookmarks

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 07:54 PM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Advertisement
Testar
Advertisement
Bintel
Advertisement