Another good tip to reduce binary size is to check if all the imports used are really needed. Just using a constant from a package also pulls in all its code. It would be great if Go could do some link time optimization to remove all unused parts of packages during compilation.
It may be worth noting that HEIF supports some features not available in JPEG, such as transparency or 10-bit color support. Therefore, the conversion may be even more lossy than just re-encoding the image data.
Another good tip to reduce binary size is to check if all the imports used are really needed. Just using a constant from a package also pulls in all its code. It would be great if Go could do some link time optimization to remove all unused parts of packages during compilation.
It may be worth noting that HEIF supports some features not available in JPEG, such as transparency or 10-bit color support. Therefore, the conversion may be even more lossy than just re-encoding the image data.