How to decrease image size(height, width) without losing its resolution and quality - image

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

Related

Drag and drop custom image: at what size does the system automatically fade the outer edge?

I'm using IDragSourceHelper::InitializeFromBitmap() to create an image behind the mouse cursor during a drag & drop. It works great, but for larger images, it seems that the system will do a transparency fade around the edges of the image. That is reasonable, however I would like to keep the image size below that limit. So how do I programmatically find the size limit that the system is using?
The outer edges of drag image are blended out if the image width or height exceeds 300 pixels.
For example, here is a bitmap that has a width of 300 pixels.
And here is the same bitmap resized to a width of 301 pixels.

How to perform scale to fit / fill?

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.

Image percentWidth 100 height stays original image height (margin)

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.

Open graph maximum image aspect ratio is 3:1, what about minimum?

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

Image shrink in Expression blend

I am designing a picture in Expression Blend. I need some help with the sizing of the images. If I don't specify any size, it will render the image at full size, but I want it to be restricted by height and width. If the window resizes, the images should resize.
Set the Stretch property to Uniform.
Have you tried setting the height and width of the picture to 100%

Resources