Updated a bit ....
https://www.dpreview.com/forums/post/5394197 - see for LZW patent, I tested
rgba-float
project rendering one frame into LZW-compressed tiff, and it worked, at least
I can see image/alpha in GIMP (2.10.18).
I wonder how many tiff readers today ready to deal with lzma2 compressed tiffs?
I wonder if I should try to add png compression level to GUI :}
---------- Пересланное сообщение ----------
Тема: filetiff patch
Дата: Воскресенье 15 марта 2020
Отправитель: Andrew Randrianasulu <[email protected]>
Получатель: "Cinelerra.GG" <[email protected]>
I tried few more compression schemas from libtiff 4.0.10 tiff.h:
#define TIFFTAG_COMPRESSION 259 /* data compression technique */
#define COMPRESSION_NONE 1 /* dump mode */
#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */
#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */
#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */
#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */
#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */
#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */
#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */
#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */
#define COMPRESSION_T85 9 /* !TIFF/FX T.85 JBIG
compression */
#define COMPRESSION_T43 10 /* !TIFF/FX T.43 colour
by layered JBIG compression */
#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */
#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */
#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */
#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */
/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <[email protected]) */
#define COMPRESSION_IT8CTPAD 32895 /* IT8 CT w/padding */
#define COMPRESSION_IT8LW 32896 /* IT8 Linework RLE */
#define COMPRESSION_IT8MP 32897 /* IT8 Monochrome picture */
#define COMPRESSION_IT8BL 32898 /* IT8 Binary line art */
/* compression codes 32908-32911 are reserved for Pixar */
#define COMPRESSION_PIXARFILM 32908 /* Pixar companded 10bit LZW */
#define COMPRESSION_PIXARLOG 32909 /* Pixar companded 11bit ZIP */
#define COMPRESSION_DEFLATE 32946 /* Deflate compression */
#define COMPRESSION_ADOBE_DEFLATE 8 /* Deflate compression,
as recognized by Adobe */
/* compression code 32947 is reserved for Oceana Matrix <[email protected]> */
#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */
#define COMPRESSION_JBIG 34661 /* ISO JBIG */
#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */
#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */
#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */
#define COMPRESSION_LERC 34887 /* ESRI Lerc codec:
https://github.com/Esri/lerc */
/* compression codes 34887-34889 are reserved for ESRI */
#define COMPRESSION_LZMA 34925 /* LZMA2 */
#define COMPRESSION_ZSTD 50000 /* ZSTD: WARNING not registered
in Adobe-maintained registry */
#define COMPRESSION_WEBP 50001 /* WEBP: WARNING not registered
in Adobe-maintained registry */
Sadly, only deflate worked with 32-bit floating point session.
Others complained like
FileTIFF: Compression scheme 32908 scanline encoding is not implemented.
Also, GIMP complained a bit, but allow me to open image anyway:
tiff_io_warning: [TIFFReadDirectory] Sum of Photometric type-related color
channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color
channels as ExtraSamples.
tiff_io_warning: [TIFFReadDirectory] Sum of Photometric type-related color
channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color
channels as ExtraSamples.
tiff_io_warning: [TIFFReadDirectory] Sum of Photometric type-related color
channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color
channels as ExtraSamples.
tiff_io_warning: [TIFFReadDirectory] Sum of Photometric type-related color
channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color
channels as ExtraSamples.
bps: 32
load_contiguous
bytes_per_pixel: 16, format: 16
Probably for other compression schemas differet, non-scanline method of calling
libtiff must be used?
Also, a bit of nipicking (?) but Cinelerra doesn' show single-frame rendering
correctly in stats:
** rendered 0 frames in 14.170 secs, 0.000 fps
Render::render_single: Session finished.
** rendered 355 frames in 249.619 secs, 1.422 fps
Render::render_single: Session finished.
** rendered 0 frames in 3.640 secs, 0.000 fps
Shouldn't it be 1 frame, at least?
-------------------------------------------------------
diff --git a/cinelerra-5.1/cinelerra/filetiff.C b/cinelerra-5.1/cinelerra/filetiff.C
index cde59a0..f014da5 100644
--- a/cinelerra-5.1/cinelerra/filetiff.C
+++ b/cinelerra-5.1/cinelerra/filetiff.C
@@ -109,6 +109,12 @@ const char* FileTIFF::compression_to_str(int value)
case FileTIFF::PACK_BITS: return "Pack Bits"; break;
case FileTIFF::DEFLATE: return "Deflate"; break;
case FileTIFF::JPEG: return "JPEG"; break;
+ case FileTIFF::PIXARFILM: return "PIXARFILM"; break;
+ case FileTIFF::PIXARLOG: return "PIXARLOG"; break;
+ case FileTIFF::JP2000: return "JP2000"; break;
+ case FileTIFF::SGILOG: return "SGILOG"; break;
+ case FileTIFF::LZMA: return "LZMA"; break;
+ case FileTIFF::ADOBE_DEFLATE: return "Adobe Deflate"; break;
default:
return "None";
break;
@@ -474,6 +480,24 @@ int FileTIFF::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
case FileTIFF::JPEG:
compression = COMPRESSION_JPEG;
break;
+ case FileTIFF::PIXARFILM:
+ compression = COMPRESSION_PIXARFILM;
+ break;
+ case FileTIFF::PIXARLOG:
+ compression = COMPRESSION_PIXARLOG;
+ break;
+ case FileTIFF::JP2000:
+ compression = COMPRESSION_JP2000;
+ break;
+ case FileTIFF::LZMA:
+ compression = COMPRESSION_LZMA;
+ break;
+ case FileTIFF::SGILOG:
+ compression = COMPRESSION_SGILOG;
+ break;
+ case FileTIFF::ADOBE_DEFLATE:
+ compression = ADOBE_DEFLATE;
+ break;
default:
compression = COMPRESSION_NONE;
break;
@@ -656,9 +680,15 @@ int TIFFCompression::handle_event()
void TIFFCompression::create_objects()
{
add_item(new TIFFCompressionItem(gui, FileTIFF::NONE));
-// add_item(new TIFFCompressionItem(gui, FileTIFF::LZW));
+ add_item(new TIFFCompressionItem(gui, FileTIFF::LZW)); // patent expired in 2004 ?
add_item(new TIFFCompressionItem(gui, FileTIFF::PACK_BITS));
-// add_item(new TIFFCompressionItem(gui, FileTIFF::DEFLATE));
+ add_item(new TIFFCompressionItem(gui, FileTIFF::DEFLATE)); // works!
+// add_item(new TIFFCompressionItem(gui, FileTIFF::SGILOG)); scanline encoding not implemented
+ add_item(new TIFFCompressionItem(gui, FileTIFF::LZMA)); // works, a bit new for data exchange?
+// add_item(new TIFFCompressionItem(gui, FileTIFF::ADOBE_DEFLATE)); scanline encoding not implemented
+// add_item(new TIFFCompressionItem(gui, FileTIFF::PIXARFILM)); not supported for scanline encoding
+// add_item(new TIFFCompressionItem(gui, FileTIFF::PIXARLOG)); only 8 bit ?
+// add_item(new TIFFCompressionItem(gui, FileTIFF::JP2000)); doesn't support scanline encoding
// add_item(new TIFFCompressionItem(gui, FileTIFF::JPEG));
}
diff --git a/cinelerra-5.1/cinelerra/filetiff.h b/cinelerra-5.1/cinelerra/filetiff.h
index 321ea9b..c6e21f5 100644
--- a/cinelerra-5.1/cinelerra/filetiff.h
+++ b/cinelerra-5.1/cinelerra/filetiff.h
@@ -70,7 +70,13 @@ public:
LZW,
PACK_BITS,
DEFLATE,
- JPEG
+ JPEG,
+ PIXARFILM,
+ PIXARLOG,
+ JP2000,
+ ADOBE_DEFLATE,
+ SGILOG,
+ LZMA
};
Mutex *unit_lock;
--
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin