antialiasing

SKCropNode masking edge anti-aliasing

你。 提交于 2019-12-30 04:06:10
问题 I created a circular mask and animate a sprite inside the mask by using sprite kit SKCropNode class. But the edge of the mask looks pixellated. Is there a way to use anti-aliasing to smooth the edges? 回答1: If you want to mask any SKNode/SKSpriteNode with an anti-aliasing effect - you can use SKEffectNode instead of SKCropNode. It works with animated nodes as well. Here is an example: // Set up your node SKNode *nodeToMask = [SKNode node]; // ... // Set up the mask node SKEffectNode *maskNode

Why does this transparent PNG cause borders when combined using GD?

有些话、适合烂在心里 提交于 2019-12-29 07:42:34
问题 I am trying to create an image from an another image using PHP. Here is my code: <?php $width = 109; $height = 109; $image = imagecreatetruecolor($width, $height); $source_under = imagecreatefrompng('ecloid_under.png'); $black = imagecolorallocate($image, 0x00, 0x00, 0x00); imagecolortransparent($image, $black); imagecopy($image, $source_under, 0, 0, 0, 0, $width, $height); header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> So I am loading this image in $source

Smoothing jagged edges without anti-aliasing - Unity3D

故事扮演 提交于 2019-12-25 05:29:33
问题 Is there a way to smooth out jagged edges of a cube without applying anti-aliasing? This is what my cube currently looks like. I do not want to use anti-aliasing because it does not work when I export the game to Windows Store. 来源: https://stackoverflow.com/questions/29864602/smoothing-jagged-edges-without-anti-aliasing-unity3d

Antialias height map edge using Java 2D

眉间皱痕 提交于 2019-12-25 01:46:03
问题 I'm using Java 2D to render a terrain map. Terrain Map looks like this: You can see how the edges are rather jagged. I want to render the edge of the terrain smoothly, but turning on antialiasing with RenderingHints doesn't work because I render the terrain map one column at a time. Here's my code to render the terrain: // terrainImageG2 renders to a BufferedImage, obtained via BufferedImage.createGraphics() terrainImageG2.setBackground(Color.WHITE); terrainImageG2.clearRect(0, 0, NUM_WIDE,

Blending antialiased circles

丶灬走出姿态 提交于 2019-12-25 01:45:12
问题 I've implemented Xiaolin Wu algorithm to draw an antialiased circle. And it works. However, in my app, I can draw on the screen many circles and they don't have full opacity. So, I want to blend them. Before implementing antialiasing Xiaolin Wu algorithm my blending method worked. I use very simple blending: int blendColors(int a, int b, float t) { double s = sqrt((1 - t) * a * a + t * b * b); return s; } void setPixel(int index, int r, int g, int b, int a, unsigned char* data) { int oldR =

iOS - CAShapeLayer anti-aliasing?

落爺英雄遲暮 提交于 2019-12-24 03:14:09
问题 I have two rhombus shapes next to each other, and I'd like the edges of them to fit together seamlessly. At the moment, due to anti-aliasing, the background bleeds through even though the edges are as close together as possible. I'd like not to have to overlap the shapes. Does anyone have any tips? Thanks 回答1: You should be able to use something like this. yourLayer.magnificationFilter = kCAFilterNearest; You'll need to import QC first but you prob already have. EDIT magnificationFilter The

IE7 and “jaggies” around layered PNGs (with jQuery)

人盡茶涼 提交于 2019-12-23 15:37:32
问题 I seem to be experiencing "jaggies" ( jagged pixelation, black in this case ) around PNG files, specifically with anti-aliased edges such as rounded borders ( say, a large glossy button for example ) in IE7 . I think I've experienced this issue before, however it may not have been as obvious in a previous design. Thing is, it only appears when I fade the PNG ( and in this case, fade in another for a snazzy rollover effect ) because initially, it appears fine. Anyways, I'm not too certain

Antialiasing algorithm?

柔情痞子 提交于 2019-12-23 09:39:24
问题 I have textures that i'm creating and would like to antialias them. I have access to each pixel's color, given this how could I antialias the entire texture? Thanks 回答1: The basic method for anti-aliasing is: for a pixel P, sample the pixels around it. P's new color is the average of its original color with those of the samples. You might sample more or less pixels, change the size of the area around the pixel to sample, or randomly choose which pixels to sample. As others have said, though:

Pyglet OpenGL drawing anti-aliasing

流过昼夜 提交于 2019-12-23 07:08:43
问题 I've been looking around for a way to anti-alias lines in OpenGL, but none of them seem to work... here's some example code: import pyglet from pyglet.gl import * window = pyglet.window.Window(resizable=True) @window.event def on_draw(): window.clear() pyglet.gl.glColor4f(1.0,0,0,1.0) glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glEnable (GL_BLEND) glEnable (GL_LINE_SMOOTH); glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE) glLineWidth (3) pyglet.graphics.draw(2, pyglet.gl.GL_LINES, ('v2i',

How to get “crispEdges” for SVG text?

雨燕双飞 提交于 2019-12-23 02:31:24
问题 Svg shapes other than text are affected by the shape-rendering attribute which can be set to the crispEdges value (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering). This value seems to turn anti-aliasing off. But text is only affected by text-rendering . However, this does not provide the crispEdges value (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-rendering). Why? Is there another way to get non-anti-alias? 回答1: For really crisp edges, you can