scaling

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

风流意气都作罢 提交于 2019-11-27 06:20:53
I have an image that is 100x100 in pixels. I want to show it twice the size, so 200x200 and I want to do it by CSS and (explicitly) not by the server. Since a few years, images get anti-aliased by all browsers instead of doing a by-pixel scale. Mozilla allows to specify the algorithm: image-rendering: -moz-crisp-edges; So does IE: -ms-interpolation-mode: nearest-neighbor; Any known webkit alternative? Unfortunately, it looks like this feature is absent in WebKit. See this recent bug report: https://bugs.webkit.org/show_bug.cgi?id=40881 WebKit now supports the CSS directive: image-rendering:

PIL how to scale text size in relation to the size of the image

醉酒当歌 提交于 2019-11-27 05:39:25
问题 I'm trying to dynamically scale text to be placed on images of varying but known dimensions. The text will be applied as a watermark. Is there any way to scale the text in relation to the image dimensions? I don't require that the text take up the whole surface area, just to be visible enough so its easily identifiable and difficult to remove. I'm using Python Imaging Library version 1.1.7. on Linux. I would like to be able to set the ratio of the text size to the image dimensions, say like 1

Making Sense of Android meta-viewport scaling: What am I missing?

旧巷老猫 提交于 2019-11-27 05:04:10
问题 I have been trying to determine how the viewport -- and the contents within -- are affected by the viewport meta tag used for drawing content with WebView or with the native browser. What I have run in to are some apparent inconsistencies. I created a small page (see below) with an image and some javascript for displaying the viewport size so I can visually see the scaling with the image as well as get the exact numbers. First, a some observations: None of the viewport width numbers are

Android image scaling to support multiple resolutions

一曲冷凌霜 提交于 2019-11-27 03:50:09
问题 I've coded my game for 320x480 and I figure that the easiest way to support multiple resolutions is to scale the end image. What are your thoughts on this? Would it be cpu efficient to do it this way? I have all my images placed in the mdpi folder, I'll have it drawn unscaled on the screen onto a buffer, then scale it to fit the screen. all the user inputs will be scaled as well. I have these 2 questions: -How do you draw a bitmap without android automatically scaling it -How do you scale a

What does the filter parameter to createScaledBitmap do?

烈酒焚心 提交于 2019-11-27 02:43:44
The declaration of android.graphics.Bitmap.createScaledBitmap is public static Bitmap createScaledBitmap (Bitmap src, int dstWidth, int dstHeight, boolean filter) However, the documentation doesn't explain any of the parameters. All of them are pretty obvious except for boolean filter . Does anyone know what it does? A quick dig through the SKIA source-code indicates that (at least by default) the FILTER flag causes it to do a straightforward bilinear interpolation. Check Wikipedia or your favorite graphics reference to see what the expected consequences are. Traditionally, you want to do

SKNode scale from the touched point

可紊 提交于 2019-11-27 01:58:39
问题 I have added UIPinchGestureRecognizer to my scene.view to scale my content. I actually scale the parent node where all my visible contents reside. But I have problem though with scaling point. The thing is node scale from the lower-left corner. It's definitely not what I want. Do I have to write lots of code to be able to scale from the point where pinching occurs? Could you please give some hints as to what way to follow. 回答1: I have been working on the same problem and my solution is shown

Scaling to a fixed point in KineticJS

こ雲淡風輕ζ 提交于 2019-11-27 01:42:11
问题 I'm having some problems with scaling a container to a fixed point. In my case I'm trying to scale (zoom) a stage to the mouse cursor. Here is a way to do with pure canvas: http://phrogz.net/tmp/canvas_zoom_to_cursor.html (as discussed at Zoom Canvas to Mouse Cursor) I just can't get figure out how to apply the same logic while using the KineticJS API. Sample code: var position = this.stage.getUserPosition(); var scale = Math.max(this.stage.getScale().x + (0.05 * (scaleUp ? 1 : -1)), 0); this

Stop Firefox DPI Scaling (when Windows setting is at 125%)

拥有回忆 提交于 2019-11-27 01:15:02
问题 I'm currently making a webpage and testing it in chrome works fine, but in Firefox - it is zoomed in. This is because my DPI in Windows is set to 125%, and Firefox detects this, and adjusts every webpage accordingly. However, my webpage is not meant to be viewed at such a zoom level, the images aren't made to be displayed that big, and hence it looked blurred/pixelated. The general layout of the page is messed up too, because everything is so big. Now, this doesn't affect most people - as

Is it possible to adjust a font's vertical scaling using CSS?

家住魔仙堡 提交于 2019-11-27 00:59:49
问题 I am using an embedded font for the top navigational elements on a site Helvetica65 and at 16px it is the perfect WIDTH but I need it to be about 90% of it's current height. In Photoshop, the solution is simple - adjust the vertical scaling. Is there a way to do essentially the same thing using CSS? And if so, how well is it supported? Here is a jsFiddle of the basic nav coding. 回答1: transform property can be used to scale text: .menu li a { color: #ffffff; text-transform: uppercase; text

How to “scale” a numpy array?

江枫思渺然 提交于 2019-11-27 00:55:20
问题 I would like to scale an array of shape (h, w) by a factor of n, resulting in an array of shape (h*n, w*n), with the. Say that I have a 2x2 array: array([[1, 1], [0, 1]]) I would like to scale the array to become 4x4: array([[1, 1, 1, 1], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1]]) That is, the value of each cell in the original array is copied into 4 corresponding cells in the resulting array. Assuming arbitrary array size and scaling factor, what's the most efficient way to do this? 回答1: You