Image scaling by CSS: is there a webkit alternative for -moz-crisp-edges?

WebKit now supports the CSS directive: image-rendering:-webkit-optimize-contrast; You can see it working in action using Chrome and the last image on this page: http://phrogz.net/tmp/canvas_image_zoom.html The rules used on that page are: .pixelated { image-rendering:optimizeSpeed; /* Legal fallback */ image-rendering:-moz-crisp-edges; /* Firefox */ image-rendering:-o-crisp-edges; /* Opera */ image-rendering:-webkit-optimize-contrast; /* Safari */ image-rendering:optimize-contrast; /* CSS3 Proposed */ … Read more

Scaled Bitmap maintaining aspect ratio

This will respect maxWidth and maxHeight, which means the resulting bitmap will never have dimensions larger then those: private static Bitmap resize(Bitmap image, int maxWidth, int maxHeight) { if (maxHeight > 0 && maxWidth > 0) { int width = image.getWidth(); int height = image.getHeight(); float ratioBitmap = (float) width / (float) height; float ratioMax … Read more