View Full Version : Any function to find the size of a given pixel of the image?
Overdrive80
26th November 2012, 03:15
Hi, I guess if exists some function for determining size of pixel
For example:
float length= getpixel(0,0).length() # Decimal inches
float width = getpixel(0,0).width()
Mug Funky
26th November 2012, 07:25
i'm not sure if you're looking for pixel aspect ratio or a ruler...
Overdrive80
26th November 2012, 09:43
Im looking for size pixel for re-writing a function, it use this info for identifying type of source for others reasons
Didée
26th November 2012, 10:33
A pixel has the dimensions: width = 1 pixel, height = 1 pixel. Then there is the width/height relation known as "aspect ration", but that's it. No such thing as a "physical" dimension. For that you need a correlated measure like "DPI" in digital images. For video, DPI information usually doesn't exist. And when importing images (with embedded DPI information) into Avisynth, the DPI information is lost, AFAIK.
And in case "aspect ratio" is what you're looking for in fact: this information usually doesn't exist in Avisynth either, everything is pixelaspect 1:1 there. External applications like e.g. MeGUI might embedd the AR, by figuring it by themselves from the source file, and writing the value into the script (as global variable). But that's a specific of the frontend, and not an Avisynth thing.
Overdrive80
26th November 2012, 15:20
Ok, I did think that as video is composited for images, its would have dpi info. For your answer, with avisynth is impossible. Thanks for clarification.
Guest
26th November 2012, 16:43
You have screen metrics for your desktop. You could obtain that from a windows call and combine that with knowledge of the resolution in pixels to generate a "size per pixel". You'd have to write a plugin for that because there is no such existing function in Avisynth.
Overdrive80
26th November 2012, 22:15
You have screen metrics for your desktop. You could obtain that from a windows call and combine that with knowledge of the resolution in pixels to generate a "size per pixel". You'd have to write a plugin for that because there is no such existing function in Avisynth.
Unfortunately, I haven´t knowledges nor means for that. Thanks
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.