Skip to main content
Known Participant
November 17, 2008
Question

How to calculate the image coordinates?

  • November 17, 2008
  • 8 replies
  • 1595 views
Hello. I have an automate plugin, in which i need to calculate the real image size and coordinates on layer (without transparent area around the image).
Is it possible to do this with SDK help?
This topic has been closed for replies.

8 replies

_sax0n_Author
Known Participant
November 29, 2008
Thx for Your help. I didn't notice this information in the getter output file. topic is closed. thx everybody for Your help.
_sax0n_Author
Known Participant
November 27, 2008
there is must be another way to get this values... with PS API help.
anybody can help?
Known Participant
November 29, 2008
On Thu, 27 Nov 2008 02:05:24 -0800, sax0n@adobeforums.com wrote:

I'll be glad to try to help, but I would need a more complete description
of what you are trying to do.

Do you have the SDK? What type of plugin are you writing, or is this a
script? Have you studied the SDK's examples of plugins that manipulate the
image rectangle? PoorMansTypeTool is a good place to start.

Perhaps you could post some of your code, and see if others have
suggestions on how to do it differently.
_sax0n_Author
Known Participant
November 26, 2008
Done this ))
my mistake was - swaped the x and y %)
but may values different in +- 2-15 pixels with PS...
interest... thx everubody
_sax0n_Author
Known Participant
November 26, 2008
2Ondrej Psencik: yes, I realized it to. but it not working on transparent channel, but work's on BYTE array.
is the transparency array is BYTE array?
Participating Frequently
November 24, 2008
To Curvemaister

Your tip is absolutely unusefull in his scenario. You have to mask image with own algorithm to get real bounding box.

In the FilterRecord the rectangle meaning is something else.

I have implemented that simple, basic school algorithm and calculation is ok. Using tranparency channel.
_sax0n_Author
Known Participant
November 24, 2008
I think this way is wrong..
when you select in PS layer and click copy, and then click File->New it ask's you to create a new document with a bounds as selected image in layer. it seems PS know that values. and it is must exist some routine to read them.
but what routine?
Known Participant
November 24, 2008
If you want the image rectangle, that is available. Download the SDK, and
look at some of the examples. For a filter plugin, for example, the
boundary rectangle of the image is available in the FilterParameterBlock.
_sax0n_Author
Known Participant
November 22, 2008
Can I watch your code?
or could You tell me the algorithm, in which You have calculated this?
wbr
Participating Frequently
November 18, 2008
Hi,

as indicated in your post in which you want pixels ... you need pixels :-)

Then you can create bounding box based on alpha channel.

However do not forget that image can be in various modes (8-bit, 16-bit, ...)

I did it in my plugin and it is working as supposed.