According to the open graph documentation the maximum aspect ratio for an image is 3:1. An aspect ratio, the way I understand it, is width to height. Hence given the 3:1 requirement the width of an image can be up to 3x the height.
This however, does not seem to set any limit on the height of an image? Is there a minimum aspect requirement as well? Otherwise it would seem you could have an image for example which is 50px wide, but 500px tall?
Thanks
Related
I want to scale an image to fit or fill certain width while keeping the aspect ratio.
For example, when the server receives 1200x800 image without knowing the image size and I want to scale it down to 300x200 by specifying only width=300.
Note that I would specify either width or height, not both.
Also, I wouldn't want to scale up to make it bigger size, if the original image is small.
resize_to_fit does what I want.
Even though, doc says both width and height are required, you can actually perform scale_to_fit effect by providing either only width or only height to resize_to_fit function.
Is there any formula to calculate image resolution, if provided with image size and image height and width. I googled for an answer, but didnt get much of a help. Got one formula, but if i calculate with height and width of an image, the resolution i got is different from actual resolution.
Also if i have take a pic from 42 mega Pixel camera and 32 mega pixel camera, will the image size and dimensions vary?
Thanks Jithen
It's a simple cross-multiplication
if your image is supposed to have a width of 10 inches and is 1000 pixels wide, its horizontal resolution is 1000 / 10 = 100 ppi (pixels per inch).
Do I missed something ?
What happens with the code below is that image width is scaled to 100% as expected and the height also scales as expected keeping the aspect ratio correct. Issue is that there is a margin at the bottom and that seems to be the height of the original contentHeight of the image. How can I get rid of that?
I am using percentages so that it scales when device orientation changes.
backdrop.source = "http://cf2.imgobject.com/t/p/" + "w342" + data.backdrop;
backdrop.scaleMode = "letterbox";
backdrop.horizontalAlign = "left";
backdrop.verticalAlign = "top";
backdrop.smooth = true;
backdrop.percentWidth = 100;
The answer to your question is don't use the letterbox setting. That is going to preserve the aspect ratio and make the black area, hence the name letterbox :)
Try setting scaleMode to zoom instead. As the documentation states, zoom will result in one axis being clipped. This should scale the image, preserve the aspect ratio, but clip some edges of the image to avoid having the black area.
Other solutions to this problem are:
modify the original image outside of Flash
use a mask to achieve similar results that the zoom setting will provide. In this approach you make the image bigger, but then apply a square mask to the image. The mask reveals only the square portion ... clipping what is outside the mask.
(undesirable in most cases) use the scaleMode setting of strectch (and specify both width/height) so that the area is filled, this will not preserve the aspect ratio
PS: There is no way to avoid the black area if the image's aspect ratio is not square. Even with HTML/CSS. This is just math/geometry. The same thing happens in HTML -- the image is either stretched, clipped, or will not fill both dimensions.
[Edit]
PPS: One other idea, if you know the original aspect ratio of the image, is to calculate a new width that will be closest to the desired width, but naturally preserves the width to height aspect ratio.
For example, the width:height ratio is 4:3. Your desired width is 500 pixels. Using cross products you get this:
4 500
- = -
3 x
Using cross products you get the equation:
4x = 3*500
Now solve for x:
x = 3*500/4 = 375
Therefore, if the original aspect ratio is 4:3, you can set a width of 500 and a height of 375 to scale the image and not have any black areas. You can even write code that dynamically calculates the aspect ratio, and applies this logic to scale something nicely. The point is that you have to the respect aspect ratio when scaling the image to avoid the "black" areas.
I want to decrease height and width of a image without losing its resolution, so afterwards if i want to make image height and width as original, it looks same.
I dont know how this can be achieved. Will just changing image's height and width and later increasing will result in loss of resolution to image?
Got to the Image > Image Size > Resample Image and select Bicubic Sharper from the dropdown menu and you can get the output
I am confused in deciding the dimensions for a background image for my website. I am creating a collage like image in picasa and it defines the image dimensions using aspect ratios. If I want to create an image of 2048 x 1800, what aspect ratio should I use?
Wolfram Alpha gives the exact result 256/225, so an aspect ratio of 256:225 is correct. (Of course, a more inexact value would be 1.14:1, which would give you something like 2052x1800.)
As the aspect ratio is the ratio of the width of the image to its height, the aspect ratio of 2048x1800 image is 1.14:1 (2048/1800 = 1.14).