Code Monkey home page Code Monkey logo

Comments (4)

lovell avatar lovell commented on June 10, 2024

I think this image might be slightly corrupt (there are quite a few unknown TIFF tags) and/or have invalid/unexpected data.

This is likely to relate to bit depth - the image claims to be 16-bit but contains what appears to be 8-bit values.

Depth: 16/8-bit
Channel depth:
gray: 8-bit

Using vips at the command line, the maximum pixel value is only 161. I would expect this to be 65535.

$ vips max 澳门WGS84.tif
(vips:21878): VIPS-WARNING **: 12:40:10.974: Unknown field with tag 33550 (0x830e) encountered
(vips:21878): VIPS-WARNING **: 12:40:10.974: Unknown field with tag 33922 (0x8482) encountered
(vips:21878): VIPS-WARNING **: 12:40:10.974: Unknown field with tag 34735 (0x87af) encountered
...
161.000000

Do you know the source of this image e.g. which software was used to create it?

from sharp.

ShareQiu1994 avatar ShareQiu1994 commented on June 10, 2024

@lovell Thanks!
I can use your method to convert TIF to digits and browse PNG thumbnails normally

I use the Python OpenCV library to implement it

The code is as follows

import cv2
image_16bit = cv2.imread('am.tif', cv2.IMREAD_UNCHANGED)
image_8bit = cv2.normalize(image_16bit, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8U)
cv2.imwrite('am2.tif', image_8bit)

am2.zip

But I cannot effectively convert TIF files to 8-bit using Sharp
Can Sharp find a way to solve the conversion problem?

from sharp.

ShareQiu1994 avatar ShareQiu1994 commented on June 10, 2024

2f900ecc173174e91fe8fcb4f172a38

from sharp.

ShareQiu1994 avatar ShareQiu1994 commented on June 10, 2024

reply “Do you know the source of this image e.g. which software was used to create it?“

This TIF image is DEM digital elevation data captured by Advanced Land Observing Satellite 1
https://search.asf.alaska.edu/#/

from sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.