Disabling anti-aliasing in Image Canvas, lazarus / 39-Graphics ---------------------------------------------------------------------- cov · 2026-01-08 16:26 I'm trying to transfer text rendered onto a Tbitmap canvas onto another image canvas, but I cannot get rid of the anti aliasing. This is the image file created (attached), which is unusable: Reducing the image.PixelFormat:=pf1bit and specifying Image.Monochrome as True gives me an error message. Runerror (204), invalid pointer operation in the file dynarr.inc at line 129. Is there a way to disable text antialiasing? ---------------------------------------------------------------------- wp · 2026-01-09 17:13 You mean you want to remove the extra anti-aliasing pixels from an existing bitmap? I think that's not possible (at least not easily). ---------------------------------------------------------------------- cov · 2026-01-09 20:34 No. The image is just to show the anti aliasing. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i       bmp:= TBitmap.Create;      bmp.Canvas.TextOut(0,2,'1.789 m³/Hr WATER');       I want to transfer the image onto the screen pixel by pixel. This is so that I can add additional information related to the text behind each pixel. I hope this makes sense. I'm aware that I could simply Bitblock copy the canvas to the screen, but I'm planning to map each pixel to an array with more information. The image was simply generated by using bmp.SaveToFile('/tmp/image.bmp') to illustrate what I meant. ---------------------------------------------------------------------- jamie · 2026-01-09 22:18 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i bmp.Canvas.Font.quality := fqnonAntialiased  jamie ---------------------------------------------------------------------- cov · 2026-01-10 13:05 Thanks. Unfortunately it doesn't work. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i bmp.Canvas.Font.Quality:=fqNonAntialiased; bmp.Canvas.Brush.Style := bsSolid;bmp.Canvas.Brush.Color := clWhite;bmp.Canvas.FillRect(0,0,txtW idth,txtHgt);bmp.Canvas.TextOut(0,2,'1.789 m³/Hr WATER'); ---------------------------------------------------------------------- cov · 2026-01-10 16:43 OK, thanks everyone. According to this, GTK2 does not support fqNonAntialiased. An alternative work around is suggested. ---------------------------------------------------------------------- wp · 2026-01-10 17:14 Mentioning nonAntialiased font quality gives the impression that you want to draw text in a non-antialiased way? In this case, simply paint to a monochrome bitmap like in the attached demo project.