imagemagick конвертувати tiff погіршує якість, як це запобігти?


0

Я використовую конвертувати imagemagick для отримання декількох зображень TIF з одного файлу tif. Але коли я використовую таку команду

convert image.tif single%d.tif

Я отримую зображення дуже низької якості (на зразок розмитих). Файли single1.tif, single2.tifі так далі дуже низької якості в порівнянні з якістю зображень в вихідному файлі image.tif. Потім я спробував

convert -enhance image.tif single%d.tif

Тим не менш, я отримав зображення дуже низької якості на виході.

Що мені робити, щоб отримати лише зображення оригінальної якості, розділені на кілька файлів?

Додатковий вихід тут:

convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.

convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37680 (0x9330) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.

Чи можете ви додати (посилання на) зразок багатосторінкового TIFF, що демонструє поведінку, яку ви спостерігаєте? Це звичайно не повинно статися ...
Курт Пфайфл

Чи можете ви також опублікувати наступні команди: identify image.tifі identify single*.tif?
Курт Пфайфл

Відповіді:


0

Ви можете спробувати перейти на тип зображення без втрат, а не виводити більше файлів TIFF. AFAIK, ImageMagick уникає рекомпресії за будь-яку ціну; але оскільки він кидає попередження про те, що оригінальний файл використовує стиснення старого стилю (TIFF Revision 6 JPEG до Technote 2), він може все-таки повторно стиснути їх, викликаючи нижчу якість.

Спробуйте спочатку формат без втрат; якщо це не допомагає, можливо, вам доведеться використовувати іншу бібліотеку для витягування кадрів.

convert image.tif single%d.png

або

convert image.tif single%d.bmp
Використовуючи наш веб-сайт, ви визнаєте, що прочитали та зрозуміли наші Політику щодо файлів cookie та Політику конфіденційності.
Licensed under cc by-sa 3.0 with attribution required.