imagemagick converter tiff degrada qualidade, como evitá-lo?

0

Estou usando o imagemagick convert para extrair várias imagens tif de um único arquivo tif. Mas quando eu uso o seguinte comando

convert image.tif single%d.tif

Recebo imagens de baixa qualidade (meio desfocadas). Os arquivos single1.tif , single2.tif e assim por diante são de qualidade muito baixa em comparação com a qualidade das imagens no arquivo image.tif original. Eu então tentei

convert -enhance image.tif single%d.tif

Ainda tenho imagens de baixa qualidade na saída.

O que devo fazer para obter apenas imagens com qualidade original separadas em vários arquivos?

Saída adicional está aqui:

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'.
    
por Tem Pora 14.07.2014 / 12:41

1 resposta

0

Você pode tentar converter em um tipo de imagem sem perdas em vez de gerar mais arquivos TIFF. AFAIK, ImageMagick evita recompressão a todo custo; mas como está lançando avisos de que o arquivo original está usando a compactação de estilo antigo (TIFF Revision 6 JPEG anterior à Technote 2), ele pode estar recomprimindo-os de qualquer maneira, causando menor qualidade.

Tente um formato sem perdas primeiro; Se isso não ajudar, talvez seja necessário usar uma biblioteca diferente para extrair os quadros.

convert image.tif single%d.png

ou

convert image.tif single%d.bmp
    
por 05.12.2014 / 23:04