antialiasing

C# graphics drawlines draws broken lines

只愿长相守 提交于 2021-02-20 04:28:09
问题 I am drawing ECG graphs using C# Graphics. I draw the curve using drawlines method. however line joints look broken. I tried all available options of smoothing mode and capstyle, none helps. here is sample graph1 and sample graph2 code is below: private void DrawCurve(Graphics g, cPoint[] data) { List<Point> ps = new List<Point>(); for (int i = 0; i < data.Length - 1; i++) { int x = data[i].x; int y = data[i].y; if (x > 0 && x < (Width)) { ps.Add(new Point(x, y)); } else if (x > Width) {

How to get an aliased (retro-style) HTML text effect

五迷三道 提交于 2021-02-17 05:08:09
问题 I am trying to achieve a jagged text effect with HTML and CSS text. I am aware of the webkit-font-smoothing and font-smooth properties, but even with those set to "none" and "never", the text is still smoother than I would like. Are there other css properties, or other methods I can use to force the text to be more jagged / aliased? Only caveat is it needs to be actual HTML text, not images. 回答1: A lot of text-shadow can approximate such effect. The more you add the more you get the bad

iOS - jagged edges on text and image. Why? and how to fix?

送分小仙女□ 提交于 2021-02-08 09:24:12
问题 Why are there jagged edges on some of the texts and images in the app i am developping? I have tried to go through the frames, and i have not used a division to set a frame (so the 1.134234 is not an issue), and I have tried different antialiasing methods. Does anybody have an idea? See attached for an example. EDIT: The images become jagged, when downscaled. So either resize them to fit the size directly in the actual file, OR via code as suggested in other StackOverflow questions. Now

iOS - jagged edges on text and image. Why? and how to fix?

跟風遠走 提交于 2021-02-08 09:23:31
问题 Why are there jagged edges on some of the texts and images in the app i am developping? I have tried to go through the frames, and i have not used a division to set a frame (so the 1.134234 is not an issue), and I have tried different antialiasing methods. Does anybody have an idea? See attached for an example. EDIT: The images become jagged, when downscaled. So either resize them to fit the size directly in the actual file, OR via code as suggested in other StackOverflow questions. Now

Render a Circle or Ellipse with Anti-Aliasing

大城市里の小女人 提交于 2021-01-28 05:24:19
问题 Assume I have a square raster of given size, and I want to "draw" (render) a circle (or ellipse) of given radius (or major / minor axes) and center. One way of doing this in Python with NumPy is: import numpy as np def ellipse(box_size, semisizes, position=0.5, n_dim=2): shape = (box_size,) * n_dim if isinstance(semisizes, (int, float)): semisizes = (semisizes,) * n_dim position = ((box_size - 1) * position,) * n_dim grid = [slice(-x0, dim - x0) for x0, dim in zip(position, shape)] position =

Remove anti-aliasing from an image

青春壹個敷衍的年華 提交于 2021-01-28 01:44:46
问题 I want to remove the antialiasing from an image. This code will get the 4 major colors from an image, compare each pixel to the 4 major colors and assign the closest color. import numpy as np from PIL import Image image = Image.open('pattern_2.png') image_nd = np.array(image) image_colors = {} for row in image_nd: for pxl in row: pxl = tuple(pxl) if not image_colors.get(pxl): image_colors[pxl] = 1 else: image_colors[pxl] += 1 sorted_image_colors = sorted(image_colors, key=image_colors.get,

C++: Removing Moire effect from openGL

允我心安 提交于 2021-01-27 03:54:54
问题 I draw patterns which have detailed pixels and they often face with Moire effect. I am not good at shading and I am not sure if this problem will be solved by shaders. I have not found any basic, understandable and complete example of shaders. Most of the tutorial websites start a program from the middle omitting the header file includes! This is a MWE of my code. Is it possible to mitigate or remove the Moire effect from it? #include <cmath> #include <vector> #ifdef __APPLE__ #include <GLUT

C++: Removing Moire effect from openGL

烂漫一生 提交于 2021-01-27 03:54:50
问题 I draw patterns which have detailed pixels and they often face with Moire effect. I am not good at shading and I am not sure if this problem will be solved by shaders. I have not found any basic, understandable and complete example of shaders. Most of the tutorial websites start a program from the middle omitting the header file includes! This is a MWE of my code. Is it possible to mitigate or remove the Moire effect from it? #include <cmath> #include <vector> #ifdef __APPLE__ #include <GLUT

How to force anti-aliasing in JavaFX fonts?

给你一囗甜甜゛ 提交于 2021-01-27 02:28:31
问题 While testing the GUI of my JavaFX 8 application, I noticed that some labels are not displaying anti-aliased text. After some googling and struggling, I found out a very annoying thing that is happening. The anti-aliasing is being applied only on labels which font size is greater than 80px. Here is an example comparing JavaFX and Swing applications with AA applied: Sample code: https://gist.github.com/anonymous/be60bb89181376ff12aa Is there a way to force the AA in all font sizes? Does this

How to force anti-aliasing in JavaFX fonts?

自闭症网瘾萝莉.ら 提交于 2021-01-27 02:27:09
问题 While testing the GUI of my JavaFX 8 application, I noticed that some labels are not displaying anti-aliased text. After some googling and struggling, I found out a very annoying thing that is happening. The anti-aliasing is being applied only on labels which font size is greater than 80px. Here is an example comparing JavaFX and Swing applications with AA applied: Sample code: https://gist.github.com/anonymous/be60bb89181376ff12aa Is there a way to force the AA in all font sizes? Does this