[BGRA] What's wrong with Resample Filters Lanczos2 and 4 ? lazarus / 39-Graphics ---------------------------------------------------------------------- jipété · 2024-06-14 10:38 Hello, I compare the rendering of the resampling filters and to do this, I use an image that is modified by the 11 classic filters (Box, Linear, etc.) and I noticed that when converting with The Gimp, always in the same way, the .png generated by the graphics tool to bmp's for the comparison tool, 2 files have an alpha channel (I don't know where it comes from) and the 9 other files don't have one : 9+2_layers.png Here is what I use to convert the base image:      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       img.Width  := Wd;       img.Height := Hd;      image.ResampleFilter := SelectedFilter; // image is a TBGRABitmap;// SelectedFilter is coming from another procedure, procedure TForm1.radiogroupResFiltersClick(Sender: TObject);// radiogroup Items host the 11 filtersbegin  SelectedFilter := TResamplefilter(radiogroupResFilters.ItemIndex);  imgPaint(nil);end;//      stretched := image.Resample(Wd, Hd) as TBGRABitmap;That's all. Of course, to watch the result, I then use 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       copy := image.MakeBitmapCopy(clNone);      img.Picture.Assign(copy); // and img is a TImage      copy.Free; This gives me a different rendering depending on the presence or absence of the alpha channel, and depending on the display tool used, one version or the other: 4resample.gif Lanczos3--Lanczos4(or2).png Is it a bug or a feature ? Thanks, ---------------------------------------------------------------------- circular · 2024-06-14 17:54 Hi! I am not sure about the steps to reproduce the problem. Would you have a sample program? ---------------------------------------------------------------------- jipété · 2024-06-14 22:21 Quote from: circular on June 14, 2024, 07:54:46 pmWould you have a sample program? Sorry but this afternoon I've changed the way sizes are set-up and problem has disappeared. I apologize for the inconvenience and you can delete that discussion, if you want to free disk space. Regards, ---------------------------------------------------------------------- circular · 2024-06-15 08:54 I am glad the problem is solved. This confirms the appearance of the images that looks like a problem of pixel format. Have a nice day