Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversions a little grainy at high zoom levels #9

Closed
jamez70 opened this issue Aug 19, 2024 · 19 comments
Closed

Conversions a little grainy at high zoom levels #9

jamez70 opened this issue Aug 19, 2024 · 19 comments
Assignees

Comments

@jamez70
Copy link
Collaborator

jamez70 commented Aug 19, 2024

Here is a clip from the .tif file:

image

Here is the same area roughly with 100% quality tiles. Ignore the marker over the airport as this is my app displaying the weather there.

image

What causes the degradation of the quality? Can it be improved at all?

@N129BZ
Copy link
Owner

N129BZ commented Aug 19, 2024

What is the image type being generated? Webp, png, or jpg?

@N129BZ N129BZ self-assigned this Aug 19, 2024
@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 19, 2024

I've tried webp and png and had the same results

@N129BZ
Copy link
Owner

N129BZ commented Aug 19, 2024

I'm looking into this, from what I'm finding its a known issue with gdal. It may relate to some metadata in the GeoTIFF source. Some GeoTIFFs have a device block size value that is not 256 x 256 px. - I'm looking at them using gdalinfo to see what I can find.

@N129BZ
Copy link
Owner

N129BZ commented Aug 19, 2024

Here is the metadata from wichita.vrt below. Note the X and Y resolutions. I believe gdal_translate defaults to 256x256, so it maybe has some some negative effect on the resulting tiled images that they're not being translated to the original dimensions. I'm going to experiment with reading the metadata and setting the BLOCKXSIZE and BLOCKYSIZE parameters to match the metadata values:
<Metadata> <MDI key="AREA_OR_POINT">Area</MDI> <MDI key="TIFFTAG_DATETIME">2024:06:11 11:20:03</MDI> <MDI key="TIFFTAG_RESOLUTIONUNIT">2 (pixels/inch)</MDI> <MDI key="TIFFTAG_SOFTWARE">Adobe Photoshop 24.6 (Windows)</MDI> <MDI key="TIFFTAG_XRESOLUTION">300</MDI> <MDI key="TIFFTAG_YRESOLUTION">300</MDI> </Metadata>

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 19, 2024

Oh nice! I'd just like to be as good as skyvector or vfrmap is. It actually does look like a downsampling algorithm is causing it because of the way the edges appear

@N129BZ
Copy link
Owner

N129BZ commented Aug 20, 2024

jamez70 - please test this new docker image: n129bz/chartmaker:v1.37

I added LZW lossless compression and several more -co options in the gdal_translate, gdalwarp, and gdaladdo commands, as well as upping the default zoomlevel from 1-12 to 1-13 and the default tileimagequality to 100. I think the results are definitely better, but would like a 2nd pair of eyes on this... image should be pushed within an hour.

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 20, 2024

I tried but it says
Error response from daemon: manifest for n129bz/chartmaker:v1.37 not found: manifest unknown: manifest unknown

@N129BZ
Copy link
Owner

N129BZ commented Aug 20, 2024 via email

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 20, 2024

Oh no problem. I'll try it tonight

@N129BZ
Copy link
Owner

N129BZ commented Aug 21, 2024

Sorry about the delay, I decided to make the new image from scratch. It's up now

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 21, 2024 via email

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 21, 2024

I tried.. It wasn't able to get any image

@N129BZ
Copy link
Owner

N129BZ commented Aug 21, 2024

So sorry for the delay. I ended up revamping the logic for dealing with passed arguments. I was using the asterisk as an arg to process all 53 individual area charts and discovered it blew up when running in docker (worked fine in WSL so I never caught that.)

new image is n129bz/chartmaker:v1.38

New values for a passed arg are ALL, SINGLE=X (where X is the chart number) or FULL to process whatever indexes are in the chartprocessindexes array. No passed arg defaults to the prompt for the process you want.

I also re-indexed the vfrindividualcharts array in settings.json to be zero-based like all the other arrays in there. All of the other (hopeful) improvements to image processing are still there from my original v1.36 attempt...

Thanks for your patience and time!!

--Brian

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 21, 2024 via email

@N129BZ
Copy link
Owner

N129BZ commented Aug 21, 2024

Here's what I got:
BurlingtonMuni

@N129BZ
Copy link
Owner

N129BZ commented Aug 21, 2024

A little more zoomed:
BurlingtonMuni2

@N129BZ
Copy link
Owner

N129BZ commented Aug 21, 2024

and a little more:
BurlingtonMuni3

@jamez70
Copy link
Collaborator Author

jamez70 commented Aug 21, 2024

wow that looks perfect! and I am very impressed! Nice work!

@N129BZ
Copy link
Owner

N129BZ commented Aug 21, 2024

The only "gotcha" is bigger db files... I think changing zoom level from 12 to 14 adds a lot of size. Closing issue

@N129BZ N129BZ closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants