Translating MrSid lossy compressed files into uncompressed imagery has its drawbacks, including licensing and artifacts.
Old versions of fwtools, which includes the GDAL utilities (and more), were compiled with a license that allowed for the translation of MrSid into e.g. Erdas Imagine images or GeoTiff. The licensing changed on that library, so FWTools and MS4W don’t do this anymore.
If you have a compiled version of the GDAL utilities with a legal license for converting, you still run into the issue of artifacts, e.g.
GDAL’s nearblack is a great utility for correcting this problem. If we wanted to batch this up on a windows system, it might look something like this:
FOR %f IN (*.sid) DO nearblack -o %~nf.img %f
5 thoughts on “GDAL, MrSid, and nearblack”
Actually, I should say more precisely that the artifacts are native to the lossy compressed imagery, and translation into a non-lossy format does not remove them, hence the term “lossy”.
Is there actually anyway to get rid of these artifacts? I have the same problem with ecw files and am trying to remove them with all kinds of tools but I can´t find any way to remove them
The artifacts along the edges can be removed with the nearblack utility. In general though, artifacts of lossy compression are not fixable.
Hmm, didn’t work as well as expected. Not sure if it’s a misread of the MrSid file, or a problem with running nearblack directly on a MrSid, but it might be safer to run gdal_translate first, maybe output to VRT to avoid using too much space.