OSevenCheng / OSC_TIFF

Decode TIFF(RGBA 32bit-float LZW) with C# and show in Unity
6 stars 5 forks source link

1*32 bits float R LZW (predictor 3) #1

Open CaedesCZ opened 3 years ago

CaedesCZ commented 3 years ago

Hi, I have strange issue when I try open "1*32 bits float R LZW (predictor 3)". I made my own condition for this case, but I still encounter a special error in which the preview spits out 4 images insted of 1, one only contour and the other completely unreadable. I can't figure out where the problem is, whether decompressing or having a bad float translation. Can you please look at my mistake and advise me. Thank you in advance.

ortomap

OSevenCheng commented 3 years ago

Could you give me your original tiff file?

At 2021-06-17 15:33:45, "CaedesCZ" @.***> wrote:

Hi, I have strange issue when I try open "1*32 bits float R LZW (predictor 3)". I made my own condition for this case, but I still encounter a special error in which the preview spits out 4 images, one only contour and the other completely unreadable. I can't figure out where the problem is, whether decompressing or having a bad float translation. Can you please look at my mistake and advise me. Thank you in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

CaedesCZ commented 3 years ago

With pleasure! :-)

https://wetransfer.com/downloads/30f07641e91bd33c1aabc30f6114ffb220210617081112/f85bbe46c222e1177dd9f3e45171da7020210617081136/f628b3

CaedesCZ commented 3 years ago

In return, if you want, I can send you the adjustments I made, such as loading GeoTIFF tags such as array double position and resolution, improved reading strings from the exif, removed the image flipping issue and added an exception to prevent out of bound error when loading an image.

OSevenCheng commented 3 years ago

Hi, Have you solved the problem? I don't know how to deal with floating point horizontal differencing. However, it might be my mistake that caused you got the result spit out 4 images. I only dealt with four channels (TIFF.cs lines 231-242)

At 2021-06-17 15:33:45, "CaedesCZ" @.***> wrote:

Hi, I have strange issue when I try open "1*32 bits float R LZW (predictor 3)". I made my own condition for this case, but I still encounter a special error in which the preview spits out 4 images, one only contour and the other completely unreadable. I can't figure out where the problem is, whether decompressing or having a bad float translation. Can you please look at my mistake and advise me. Thank you in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

CaedesCZ commented 3 years ago

Hi, no, but I'm still trying. :-) It looks like decompression is fine but the greyscale difference must be interpreted in some odd way. However I don't find any float examples.

Look at this page maybe you will get some idea how to use it in your code https://www.fileformat.info/format/tiff/corion-lzw.htm (The TIFF predictor algorithm)

ne 20. 6. 2021 v 10:21 odesílatel OSevenCheng @.***> napsal:

Hi, Have you solved the problem? I don't know how to deal with floating point horizontal differencing. However, it might be my mistake that caused you got the result spit out 4 images. I only dealt with four channels (TIFF.cs lines 231-242)

At 2021-06-17 15:33:45, "CaedesCZ" @.***> wrote:

Hi, I have strange issue when I try open "1*32 bits float R LZW (predictor 3)". I made my own condition for this case, but I still encounter a special error in which the preview spits out 4 images, one only contour and the other completely unreadable. I can't figure out where the problem is, whether decompressing or having a bad float translation. Can you please look at my mistake and advise me. Thank you in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OSevenCheng/OSC_TIFF/issues/1#issuecomment-864517769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUQOYAZXZZCURUMXXSZPHA3TTWQIZANCNFSM463BY3IA .

OSevenCheng commented 3 years ago

you could modify TIFF.cs line: 403 as followed to make it bright float col = BACC(Dval, x, BytesPerSample)*2f;

At 2021-06-21 15:41:52, "CaedesCZ" @.***> wrote:

Hi, no, but I'm still trying. :-) It looks like decompression is fine but the greyscale difference must be interpreted in some odd way. However I don't find any float examples.

Look at this page maybe you will get some idea how to use it in your code https://www.fileformat.info/format/tiff/corion-lzw.htm (The TIFF predictor algorithm)

ne 20. 6. 2021 v 10:21 odesílatel OSevenCheng @.***> napsal:

Hi, Have you solved the problem? I don't know how to deal with floating point horizontal differencing. However, it might be my mistake that caused you got the result spit out 4 images. I only dealt with four channels (TIFF.cs lines 231-242)

At 2021-06-17 15:33:45, "CaedesCZ" @.***> wrote:

Hi, I have strange issue when I try open "1*32 bits float R LZW (predictor 3)". I made my own condition for this case, but I still encounter a special error in which the preview spits out 4 images, one only contour and the other completely unreadable. I can't figure out where the problem is, whether decompressing or having a bad float translation. Can you please look at my mistake and advise me. Thank you in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OSevenCheng/OSC_TIFF/issues/1#issuecomment-864517769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUQOYAZXZZCURUMXXSZPHA3TTWQIZANCNFSM463BY3IA .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

CaedesCZ commented 3 years ago

Thank you! It works perfectly!

st 23. 6. 2021 v 2:40 odesílatel OSevenCheng @.***> napsal:

you could modify TIFF.cs line: 403 as followed to make it bright float col = BACC(Dval, x, BytesPerSample)*2f;

At 2021-06-21 15:41:52, "CaedesCZ" @.***> wrote:

Hi, no, but I'm still trying. :-) It looks like decompression is fine but the greyscale difference must be interpreted in some odd way. However I don't find any float examples.

Look at this page maybe you will get some idea how to use it in your code https://www.fileformat.info/format/tiff/corion-lzw.htm (The TIFF predictor algorithm)

ne 20. 6. 2021 v 10:21 odesílatel OSevenCheng @.***> napsal:

Hi, Have you solved the problem? I don't know how to deal with floating point horizontal differencing. However, it might be my mistake that caused you got the result spit out 4 images. I only dealt with four channels (TIFF.cs lines 231-242)

At 2021-06-17 15:33:45, "CaedesCZ" @.***> wrote:

Hi, I have strange issue when I try open "1*32 bits float R LZW (predictor 3)". I made my own condition for this case, but I still encounter a special error in which the preview spits out 4 images, one only contour and the other completely unreadable. I can't figure out where the problem is, whether decompressing or having a bad float translation. Can you please look at my mistake and advise me. Thank you in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/OSevenCheng/OSC_TIFF/issues/1#issuecomment-864517769 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AUQOYAZXZZCURUMXXSZPHA3TTWQIZANCNFSM463BY3IA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OSevenCheng/OSC_TIFF/issues/1#issuecomment-866432964, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUQOYA65YW4JKGXZAJFSBADTUEUP3ANCNFSM463BY3IA .