Highlighted

Arbitrary geometric transformation filter

New Here ,
Aug 22, 2020

Copy link to clipboard

Copied

Hi guys,

I am looking for a way to apply an arbitrary geometric transformation to a image / smart object. Say I have a formula like

point_source = var_1 + var_2 * point_destination

to specify how a point in the resulting destination image is mapped to a point location to be sampled in the source image. I would want a way to apply such a formula while providing the variables (var_1 and var_2) via some kind of script, input field or file.

 

Photoshop seems to have a number of dedicated geometric filters like "Adaptive Wide Angle" or "Lens Correction", but I couldn't find a way to apply a arbitrary mapping formula. I'm a software developer, so if there is no "out of the box" solution to this, I'd greatly appreciate pointing me to the best way to achieve this using the Photoshop scripting / plugin interfaces.

Cheers,
Jo

TOPICS
Actions and scripting, How to, SDK

Views

74

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Arbitrary geometric transformation filter

New Here ,
Aug 22, 2020

Copy link to clipboard

Copied

Hi guys,

I am looking for a way to apply an arbitrary geometric transformation to a image / smart object. Say I have a formula like

point_source = var_1 + var_2 * point_destination

to specify how a point in the resulting destination image is mapped to a point location to be sampled in the source image. I would want a way to apply such a formula while providing the variables (var_1 and var_2) via some kind of script, input field or file.

 

Photoshop seems to have a number of dedicated geometric filters like "Adaptive Wide Angle" or "Lens Correction", but I couldn't find a way to apply a arbitrary mapping formula. I'm a software developer, so if there is no "out of the box" solution to this, I'd greatly appreciate pointing me to the best way to achieve this using the Photoshop scripting / plugin interfaces.

Cheers,
Jo

TOPICS
Actions and scripting, How to, SDK

Views

75

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 22, 2020 0
Most Valuable Participant ,
Aug 22, 2020

Copy link to clipboard

Copied

Are you going to be creating the smart objects in the document from a raster image layer.  If you are not and the document has a smart object layer for the image you script will need to retrieve the object current transform and warping settings to see the layer's image current state.

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 22, 2020 0
New Here ,
Aug 26, 2020

Copy link to clipboard

Copied

Thanks for the hint. Since I will be the only one using this, I will make sure that I start with a "clean" smart object created from an image.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2020 0
Adobe Community Professional ,
Aug 22, 2020

Copy link to clipboard

Copied

That is pretty much what Filter > Distort > Displace does. It uses a Displacement Map, which is stored in the first two channels of a Photoshop "Maximize Compatiblity" composite.

 

I have never tried scripting it, but I did cobble together a Basic program that constructed a D-map which emulated the Sphereize filter.

 

If you don't need perfect numerical precision, you can construct on with diverse methods, like the Emboss filter, or applying Curves to a Black-White gradient. With the latter, you can inject formulas back into the mix with Davide Barranca's Parametric Curves plugin.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 22, 2020 0