antialiasing

Anti Alias, UIImage and Performance

和自甴很熟 提交于 2019-12-07 04:06:32
问题 I have a UIImage loaded into a UIImageView . The UIImage is larger than the UIImageView and it has been scaled down to fit. Obviously the scaled down UIImage shows jagged edges. What is the best way to anti-alias this image with regards to performance? I've seen this method using drawInRect but I've also read that drawInRect does not give the best performance. I've read several different articles and I've tried a few methods myself. But after reading a few more posts on the performance

HTML5 Canvas stroke not anti-aliased

。_饼干妹妹 提交于 2019-12-07 04:04:02
问题 I'm just trying to make a circle with a thick anti-aliased stroke in canvas. The circle gets drawn as expected, but the edges of the stroke are very jaggy. I keep reading that Chrome forces anti-aliasing, so not sure what to do... Fiddle: http://jsfiddle.net/nipponese/hWsxw/ HTML <div id="main"> <canvas id="myCanvas" width="400" height="400" style="border: 1px solid #000"></canvas> <div id="counter" style="height: 100px; width: 100px; border: 1px solid #000"> </div> </div> The JS + jQuery

CSS bad rendering in translateZ( ) vs scale( )

谁说胖子不能爱 提交于 2019-12-06 19:21:14
问题 I noticed that there is a big quality difference when transforming text in this 2 ways: .text1 { width: 200px; height: 22px; position: absolute; top: 40%; left: 0; transform-origin: 50% 50%; transform: scale(2); /* here */ color: red; text-align: center; font-size: 22px; } .text2 { width: 200px; height: 22px; position: absolute; top: 60%; left: 0; transform-origin: 50% 50%; transform: translateZ(400px); /* here */ text-align: center; font-size: 22px; } .perspective { width: 200px; height:

Flood fill algorithm that takes alpha into account without leaving fringes around anti-aliased lines?

[亡魂溺海] 提交于 2019-12-06 11:52:29
I've implemented a typical flood fill algorithm and it works as expected when solid colors are used where I use the Euclidean distance between the ARGB components to compare colors. My problem is that if you draw something like an anti-aliased red line on a transparent background my flood fill algorithm will not fill over most semi-transparent pixels, leaving fringes around objects. Specifically for this example, the center of the line is solid red (i.e. (255, 255, 0, 0) in ARGB format) and the fringes of the line are also solid red but the alpha of these pixels ranges down to 1% alpha (i.e.

WPF Shader Effect - antialiasing not showing

最后都变了- 提交于 2019-12-06 10:37:27
I am running to a problem where I have a WPF shader effect (modified from Rene Schulte) to simulate Dot Matrix Display (DMD). Everything works great, but all dots are aliased. See attached image. I tried many features within WPF, to bring antialiasing, nothing to do. in constructor (image within a textbox); RenderOptions.SetBitmapScalingMode(MarqueeTB, BitmapScalingMode.HighQuality); RenderOptions.SetEdgeMode(MarqueeTB, EdgeMode.Unspecified); RenderOptions.SetClearTypeHint(MarqueeTB, ClearTypeHint.Enabled); I don't think it is my graphic card or Windows config. I did some testing on two PCs,

iOS: Antialiasing fail (PNG in CALayer)

巧了我就是萌 提交于 2019-12-06 10:18:58
问题 I'm attempting to draw this image on screen: This is the code: CALayer* dullLayer = [CALayer layer]; { dullLayer.frame = CGRectMake(0,0,BUTTON_SIZE,BUTTON_SIZE); dullLayer.position = CGPointFromPoint2D( btnCenter ); dullLayer.opacity = topQuadrant ? 1.0 : 0.5; [wheelLayer addSublayer: dullLayer]; } UIImage* test = [UIImage imageNamed: @"OuterButton_Dull.png"]; dullLayer.contents = (id) [test CGImage]; This is what I get: What gives? Why are the edges so jagged? Contrast this with the Roman

EMF with forced antialiasing

倾然丶 夕夏残阳落幕 提交于 2019-12-06 06:09:59
问题 Our program needs to generate vector graphics, and we chose EMF for that. However, it seems that other programs render these images non-antialiased. I found that SVG format does have a flag to indicate that some/all objects should be antialiased. Is there any kind of flag or command inside the EMF format to indicate that we want to have antialiasing? If so, how to generate that command using System.Drawing.Imaging.Metafile class? Thank you. 回答1: EMF file is a list of GDI commands. So it won't

Change background colour of an anti-aliased image using C# with anti-aliasing

↘锁芯ラ 提交于 2019-12-06 02:21:27
I have an image where I need to change the background colour (E.g. changing the background of the example image below to blue). However, the image is anti-aliased so I cannot simply do a replace of the background colour with a different colour. One way I have tried is creating a second image that is just the background and changing the colour of that and merging the two images into one, however this does not work as the border between the two images is fuzzy. Is there any way to do this, or some other way to achieve this that I have no considered? Example image Abstractly Each pixel in your

Enable anti-aliasing with lwjgl

妖精的绣舞 提交于 2019-12-06 01:42:35
I'm running this lwjgl application: Display.setDisplayMode(new DisplayMode(500, 500)); Display.create(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-5, 5, -5, 5, -10, 5); glMatrixMode(GL_MODELVIEW); float x = 0; while (!Display.isCloseRequested()) { Display.update(); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glColor3f(1, 0, 0); x += 0.01f; glRotatef(x, x, 3 * x, 0.5f * x); glBegin(GL_QUADS); drawCube(); glEnd(); glLoadIdentity(); } Display.destroy(); Which basically draws a 1x1x1 cube in the window. Method drawCube() is this: public void drawCube(

Anti-aliasing artifacts in WPF

筅森魡賤 提交于 2019-12-06 00:29:27
I have a bizarre rendering issue when I'm trying to use anti-aliased graphics in WPF. Here's a simplified version. If I use the following XAML <Window x:Class="RenderingBug.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Width="300" Height="300"> <Grid Name="myGrid" Background="AntiqueWhite" Width="250" Height="250"> <ScrollViewer Name="myScrollViewer" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <Canvas Height="500" Width="500" Name="myCanvas" /> </ScrollViewer> </Grid