<div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>Thanks for the replies.</div><div><br></div><div>The imagery I'm working with comes from drone mapping.</div><div>The orthomosaic is generated using OpenDroneMap, in WGS84 UTM CRS</div><div>The resulting GeoTIFF is then re-projected  to Web-mercator 3857, before being run through gdal2tiles.</div><div></div><div>At this stage I'm loading the tiles as an XYZ layer directly from my hard drive, and my canvas is set at 3857 as well.</div><div></div><div>So I know that the two screenshots I attached earlier come from the same PNG file.<br></div><div><br></div><div>When I set the zoom to 1:1 as suggested, I can see the PNG files are displayed without anti-aliasing as expected. <br></div><div>But as soon as I zoom in further, anti-aliasing takes place to oversample the image.</div><div>I
 have tried changing the parameters of the Resampling section in the 
Layer Styling, but they have no effect at all (Zoomed In, Zoomed Out,  
Oversampling and "Early re-sampling" options).</div><div><br></div><div>But
 the weirder thing is that when I set my XYZ layer source as 
"Interpretation: MapTiler Terrain RGB", pixels are shown as squares when
 over-zooming, like a standard raster would, which is what I want (even 
though the data does not make any sense with the MapTiler Terrain RGB 
styling, obviously).</div><div><br></div><div>Antialising does not help 
the interpretation of my imagery, and so far the only solution I found 
was to create tiles up to zoom level 25, which is a massive amount of 
overprocessing and storage, since level 21 is enough to account for my 
2cm resolution data source. Any other suggestions are really appreciated.</div><div><br></div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 11 Mar 2023 at 18:29, Johannes Kröger (WhereGroup) <<a href="mailto:johannes.kroeger@wheregroup.com">johannes.kroeger@wheregroup.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">That looks like the layer's resampling is not set to nearest neighbor.<br>
<br>
Also be aware that QGIS will have to resample the tiles whenever the <br>
scale of the map does not match one of the pre-rendered zoomlevels of <br>
the source (and the same CRS). If you have a matching CRS, select the <br>
layer and click the "1:1" zoom icon, the image *should* match the <br>
original 100%.<br>
<br>
Cheers, Hannes<br>
<br>
Am 09.03.23 um 15:55 schrieb Richard Duivenvoorde via QGIS-User:<br>
> ( bringing it back to the list :-) )<br>
><br>
> And are you sure the image retrieved from the xyz server is not a jpeg <br>
> (compared to your original png)?<br>
> You can try to see the actual url's used via F12 (the Debugging <br>
> Development Tools panel) in QGIS.<br>
><br>
> Another option: QGIS does not respect the xyz-zoomlevels always.. so <br>
> it is very easy to go to a zoomlevel in which QGIS has to resize the <br>
> original image a little (and 'resample' it, see Rendering/Raster <br>
> settings in the Options). So to really compare QGIS image to the <br>
> original one, you have to use the 'Zoom to native resolution' in the <br>
> legend/layer context menu).<br>
><br>
> Last idea: is your project in the same CRS as the xyz service <br>
> (probably EPSG:3857?) Because if not, QGIS will also resample your <br>
> original image to 'fit' the tile in the right position in that other <br>
> crs....<br>
><br>
> (and again: I know nothing about Qt image rendering ....)<br>
><br>
> Regards,<br>
><br>
> Richard Duivenvoorde<br>
><br>
> On 3/9/23 15:36, Stephane Goldstein wrote:<br>
>> I can see the difference by comparing the .png file in an image <br>
>> editor (<a href="https://pasteboard.co/YodS7tuhtzSC.png" rel="noreferrer" target="_blank">https://pasteboard.co/YodS7tuhtzSC.png</a> <br>
>> <<a href="https://pasteboard.co/YodS7tuhtzSC.png" rel="noreferrer" target="_blank">https://pasteboard.co/YodS7tuhtzSC.png</a>>) and how it's rendered in <br>
>> QGIS (<a href="https://pasteboard.co/tcGLRc7XrsNj.png" rel="noreferrer" target="_blank">https://pasteboard.co/tcGLRc7XrsNj.png</a> <br>
>> <<a href="https://pasteboard.co/tcGLRc7XrsNj.png" rel="noreferrer" target="_blank">https://pasteboard.co/tcGLRc7XrsNj.png</a>>).<br>
>> The examples are at the same zoom level.<br>
>><br>
>> On Thu, 9 Mar 2023 at 21:46, Richard Duivenvoorde <br>
>> <<a href="mailto:rdmailings@duif.net" target="_blank">rdmailings@duif.net</a> <mailto:<a href="mailto:rdmailings@duif.net" target="_blank">rdmailings@duif.net</a>>> wrote:<br>
>><br>
>>     On 3/9/23 14:05, Stephane Goldstein via QGIS-User wrote:<br>
>>      > Hi.<br>
>>      > Is there a way to disable anti-aliasing of the png tiles <br>
>> loaded on an XYZ layer ?<br>
>><br>
>>     Hi Stephane,<br>
>><br>
>>       From what do you conclude that there is anti-aliasing going on <br>
>> with XYZ layers?<br>
>>     I use xyz layers also but I'm not aware of such behaviour?<br>
>><br>
>>     FYI: this is the code rendering the images:<br>
>> <a href="https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp</a> <br>
>> <<a href="https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp</a>> <br>
>><br>
>>     (tried to search for 'alias' but could not find anything)<br>
>><br>
>>     Note, I'm not an expert in this field, so just wondering...<br>
>><br>
>>     Regards,<br>
>><br>
>>     Richard Duivenvoorde<br>
>><br>
>><br>
><br>
> _______________________________________________<br>
> QGIS-User mailing list<br>
> <a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
<br>
-- <br>
Johannes Kröger / GIS-Entwickler/-Berater<br>
<br>
**********************************************<br>
FOSSGIS Konferenz<br>
15.-18. März 2023 in Berlin<br>
<a href="https://fossgis-konferenz.de/2023/" rel="noreferrer" target="_blank">https://fossgis-konferenz.de/2023/</a><br>
<br>
WhereGroup-Beiträge auf der FOSSGIS<br>
<a href="https://wheregroup.com/unternehmen/aktuelles/" rel="noreferrer" target="_blank">https://wheregroup.com/unternehmen/aktuelles/</a><br>
**********************************************<br>
<br>
WhereGroup GmbH<br>
c/o KK03 GmbH<br>
Lange Reihe 29<br>
20099 Hamburg<br>
Germany<br>
<br>
Tel: +49 (0)228 / 90 90 38 - 36<br>
Fax: +49 (0)228 / 90 90 38 - 11<br>
<br>
<a href="mailto:johannes.kroeger@wheregroup.com" target="_blank">johannes.kroeger@wheregroup.com</a><br>
<a href="http://www.wheregroup.com" rel="noreferrer" target="_blank">www.wheregroup.com</a><br>
Geschäftsführer:<br>
Olaf Knopp, Peter Stamm<br>
Amtsgericht Bonn, HRB 9885<br>
-------------------------------<br>
<br>
</blockquote></div></div>