all groups > dotnet drawing api > january 2007 >
You're in the

dotnet drawing api

group:

Non-proportional (non Rectangular) resizing


Non-proportional (non Rectangular) resizing GraGra33
1/21/2007 2:36:35 PM
dotnet drawing api:
Hi all...

I have developed an application for managing a very large resource of
artist's paintings and posts them to a web site. The application works well.
I'm trying to reduce the complexity of having to work with photoshop and
integrate one feature into the application > Distortion Transformations.

Background Information:

When paintings are photographed, it's impossible to get a completely perfect
image that requires straightening prior to cropping for a number of rasons -
the photographer is not standing square on to the painting, the painting is
leaning, the camera is not at the correct height, the camera causes barrel
distortion, etc...

Therefore each image must be loaded into photoshop, all 4 corners selected
using the polygonal lasso tool then manually applying a Distort
Transformation (Edit > Transform > Distort) on the selected region.

The Problem:

The GDI library comes standard with several rectangular transformations -
stretch, Skew, etc.. But these apply only to a perfect rectangular region
where all points are perpendicular to each other.

I have no problems in selecting the non-rectangular region - this is easy.
I'm stumped at trying to work out how to take this region and applying the
Photoshop like Distort Transformation.

Anyone have any pointers?

Thanks in advance...

Graeme

Re: Non-proportional (non Rectangular) resizing Oliver Sturm
1/27/2007 4:45:58 PM
Hello GraGra33,

[quoted text, click to view]

That's why they charge you so much for Photoshop :-) Seriously, I believe
you'll have to find a mathemetical algorithm to perform that kind of
transformation operation. There are some resources on the web advanced
graphical operations, so you may be able to find something there -
otherwise of course you can come up with your own algorithm, with probably
questionable results. I mean, it would be pretty easy to do the job using
a column by column approach - but then that may look stupid. You could go
row by row, but that may look just as stupid. I wonder if it would be a
good idea calculating both column by column and row by row results and
"merge" those together somehow... as I said, this is exactly the kind of
work that the Photoshop people already did, and that they charge you for.

All that said, maybe it would be a much easier way to remote control
Photoshop for the purpose? I don't really know that application
intimately, but maybe they have an automation model? Or even a
comprehensive set of command line options?


Oliver Sturm
--
Re: Non-proportional (non Rectangular) resizing GraGra33
1/28/2007 4:43:50 PM
Hi Oliver,

I had come to a similar conclusion. GDI+ is not capable of this. Need to
develop own algorithm.

Thanks for your comments.

Anyone else have any thoughts?

Graeme


[quoted text, click to view]

AddThis Social Bookmark Button