[gdal-dev] Edit geotiff in Gimp and don't lose metadata

Matt.Wilkie at yukon.ca Matt.Wilkie at yukon.ca
Thu Jan 13 15:46:39 PST 2022


Yes, a long time wish indeed! In discussing this with a colleague today I traced back my first strong desrire for such a thing back to when I got into making elevation models and discovering the hell that results with improperly set nodata. In 1994!

Now my goal is figure out how to make an external .msk file without going through the heavy processing time of using nearblack. Does anyone have a utility parameter or python snippet to create a mask file from internal Nodata value cells? or an arbitrary pixel value?

-Matt

From: Nikos Alexandris <nik at nikosalexandris.net>
Sent: January 13, 2022 4:17 PM
To: Matt.Wilkie <Matt.Wilkie at yukon.ca>
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Edit geotiff in Gimp and don't lose metadata

WoW. This is really awesome!

Whish this existed many years ago... I was using GIMP and all that magic tools but without resampling or altering the size of the image, and carefully re-applying geo-tags with the use of listgeo and geotifcp (like mentioned in https://marc.info/?l=grass-user&m=121788119621237)  :-).



On 2022-01-13 23:19, Matt.Wilkie at yukon.ca<mailto:Matt.Wilkie at yukon.ca> wrote:


I discovered that starting with v2.10.24 Gimp knows about and keeps geotiff tags intact.[0] This means we can use tools like Magic Wand fuzzy select and a host of other tools to quickly fix a host of image issues that are difficult to address using command line tools and/or code.



It gets better: Gimp reads *.msk files without any fuss. This means drastically reduced memory requirements for quickly making simple edits only to the mask layer. So a person can:



-          take a large multiband band geotiff with a mask side car file, squash the 3+ bands into 1 band

-          open the original .msk file in Gimp

-          drag and drop the squashed 1 band file on top the Gimp session

o   selecting import tif as a Layer

-          Lock the imported layer, set to 50% transparent (or whatever). This is the Visual Guide layer.

-          Paint as thou wilt on the base mask layer (Black is Nodata, White is Data)

-          Delete the visual guide layer

-          Export the base mask layer

o   Select tiff File Type

•  use Deflate compression

•  keep metadata (Geotiff will be disabled, that's okay)

•  use "input-rgb-geotiff.tif.msk" as file name

-          DONE!



(this is so awesome. :)



-Matt

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220113/837f1d5d/attachment-0001.html>


More information about the gdal-dev mailing list