trufanov-nok / scantailor-universal

ScanTailor Universal - a fork based on Enhanced+Featured+Master versions of ST
http://scantailor.org
Other
181 stars 16 forks source link

bug: color profile ignored #96

Open jg4M3H opened 2 years ago

jg4M3H commented 2 years ago

Exported TIFF doesn't contain original color profile.

trufanov-nok commented 2 years ago

And the source image is TIFF too?

Just to make sure: We are talking about embedded ICC Profiles, right?

jg4M3H commented 2 years ago
  1. And the source image is TIFF too?
  2. Just to make sure: We are talking about embedded ICC Profiles, right?

Yes. Yes.

You can manually extract ICC profile using ExifTool and later inject them in exported TIFFs. But it's making process more complicated than it should be.

trufanov-nok commented 2 years ago

Are you using a Linux machine?

jg4M3H commented 2 years ago

Windows 10.

trufanov-nok commented 2 years ago

It seems the best option to copy such metadata from various image formats into resulting Tiff image would be using exiv2 library. If you would be a Linux user I could do that and ask you to rebuild the ST from actual sources. But for Windows users any update requires building the project for Windows, which is a quite painful and will require building exiv2 for Windows too. So, I'll try to fix this when a new ST be ready.

jg4M3H commented 2 years ago

Any date for new release? I planning to write guide for community. Part of it requires using this program. Colors important for us.

trufanov-nok commented 2 years ago

Ok, I'll try to drop a bugfix release during next few days

trufanov-nok commented 2 years ago

Could you check one of these distributives? The ICC data propagation is disabled by default and you need to enable it in Settings/Output/Image Metadata. The problem is that embedded ICC profile is colorspace dependant. And ST changes bcs of the user choice (conversion to b/w at output processing step) or tries to change colorspace to optimal sometimes. For ex. I faced a problem when ST found out that all pixels in RGB image with ICC are the shades of gray and tried to convert it to grayscale colorspace in a resulting image. In this case GIMP raised ICC profile incompobility error for resulting image after ICC copiyng. So, I kept it turned off by default till all underwater stones will be found. scantailor-universal-0.2.13-64bit-install.zip scantailor-universal-0.2.13-32bit-install.zip If it works I'll drop a release.

jg4M3H commented 2 years ago

Work as expected for me. Thanks! ❤️

Possible enhancement: preview displaying with original ICC.

jg4M3H commented 2 years ago

Sorry, tested again with ExifToolGUI.exe. I was comparing to wrong output. Output from .tiff with Adobe RGB ICC doesn't contain ICC profile.

Option is enabled in settings.

Made test tiff file with Adobe RGB ICC. Produced output without ICC. scan_tailor_icc_test.zip

exiv2 -pC scan_tailor_icc_test.tif

Displaying ICC information.

Can extract with exiv2 -eC scan_tailor_icc_test.tif, ICC Profile Inspector correctly reading this extracted ICC.

trufanov-nok commented 2 years ago

Hm, I've tried to process the attached image with both Linux and Win64 (under Wine) releases - the result in out/scan_tailor_icc_test.tif does contain ICC profile. Probably some processing step interfere? Could you send me a .ScanTailor 1-page project file so I can repeat the transformations applied?

jg4M3H commented 2 years ago

I determined what this is path related issue: Russian characters (utf-8). Try place tiff in folder Tailor @!$%^#'. Буквы Test ICC.

trufanov-nok commented 2 years ago

Ok, should be fixed now, pls check these binaries scantailor-universal-0.2.13-32bit-install.zip scantailor-universal-0.2.13-64bit-install.zip

jg4M3H commented 2 years ago

Working correctly. But on Linux can also be utf-8 filenames?

trufanov-nok commented 2 years ago

Exiv2 doesn't provide utf variant of API for Linux for some reason:
https://github.com/Exiv2/exiv2/blob/old-master/include/exiv2/basicio.hpp#L245 And russian paths work on my linux machine. So I guess it's just properly converted to the system locale...