जब मैं PIL==1.1.7
का उपयोग TIFF छवियों को लोड करने के लिए, यह colorspace गलत लगता है?अजगर जनहित याचिका गलत तरीके से डिकोडिंग TIFF रंग (गलत colorspace का प्रयोग करके)?</p> <p><img src="https://i.stack.imgur.com/GDaMq.png" alt="bad colorspace conversion"></p> <p>क्या हो रहा है:
.tiff
convert test.jpg test.tiff
का उपयोग कर बनाया गया था (लेकिन अन्य टिफ फ़ाइलें भी साथ हो रहा है)- यह कम से पाया जा सकता है: http://hul.wolever.net/dump/test.tiff
- उत्पादन जब
PIL.Image.DEBUG = True
:
>>> from PIL import Image >>> Image.DEBUG = True >>> Image.open("/tmp/test.tiff").show() tag: ImageWidth (256) - type: short (3) - value: (560,) tag: ImageLength (257) - type: short (3) - value: (401,) tag: BitsPerSample (258) - type: short (3) - value: (8, 8, 8) tag: Compression (259) - type: short (3) - value: (7,) tag: PhotometricInterpretation (262) - type: short (3) - value: (2,) tag: FillOrder (266) - type: short (3) - value: (1,) tag: DocumentName (269) - type: ascii (2) - value: /tmp/lemur.tiff tag: StripOffsets (273) - type: long (4) - value: (8, 9282, 18712, 28312, 38000, 48730, 59052, 70406, 83010, 95978, 108967, 121029, 133136, 145555, 157411, 168289, 179433, 191157, 202954, 214664, 226914, 238919, 250547, 261871, 273282, 284453) tag: Orientation (274) - type: short (3) - value: (1,) tag: SamplesPerPixel (277) - type: short (3) - value: (3,) tag: RowsPerStrip (278) - type: short (3) - value: (16,) tag: StripByteCounts (279) - type: long (4) - value: (9274, 9430, 9600, 9688, 10730, 10322, 11354, 12604, 12968, 12989, 12062, 12107, 12419, 11856, 10878, 11144, 11724, 11797, 11710, 12250, 12005, 11628, 11324, 11411, 11171, 2541) tag: XResolution (282) - type: rational (5) - value: ((1207959552, 16777216),) tag: YResolution (283) - type: rational (5) - value: ((1207959552, 16777216),) tag: PlanarConfiguration (284) - type: short (3) - value: (1,) tag: ResolutionUnit (296) - type: short (3) - value: (1,) tag: PageNumber (297) - type: short (3) - value: (0, 1) tag: JPEGTables (347) - type: undefined (7) - value: ????C?? ???}!1AQa"q2??#B??R??$3br? %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz??????????????????????????????????????????????????????????????????????????? tag: YCbCrSubSampling (530) - type: short (3) - value: (2, 2) *** Summary *** - compression: jpeg - photometric_interpretation: 2 - planar_configuration: 1 - fill_order: 1 - size: (560, 401) format key: ('II', 2, 1, 1, (8, 8, 8),()) - raw mode: RGB - pil mode: RGB
तुम बस मुझे 'Image.DEBUG' को शुरू करने के लिए एक +1 मिलता है। –
ऐसा लगता है कि मुझे मूल स्रोत के साथ कोई समस्या है। मैंने आपकी छवि के साथ प्रयास किया और एक ही परिणाम प्राप्त किया। हालांकि, एक और टिफ के साथ प्रयास करना, या जेपीजी पर चलने से अपेक्षित परिणाम मिलते हैं। – sberry
@sberry। टिफ एक मोनोलिथिक प्रारूप नहीं है। यह वास्तव में एक लचीला कंटेनर की तरह है जो एकाधिक संपीड़न और छवि प्रकारों का उपयोग कर सकता है। मुझे लगता है कि यह शायद फाइल के साथ कोई समस्या नहीं है क्योंकि मेरे डेस्कटॉप का इमेज व्यूइंग प्रोग्राम फ़ाइल को अपेक्षित रूप से प्रदर्शित कर सकता है। –