• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Arbitrary geometric transformation filter

Community Beginner ,
Aug 22, 2020 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 , SDK

Views

202

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
community guidelines
Adobe
Community Expert ,
Aug 22, 2020 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

Votes

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
community guidelines
Community Beginner ,
Aug 26, 2020 Aug 26, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines
Community Expert ,
Aug 22, 2020 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.

Votes

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
community guidelines