Giter VIP home page Giter VIP logo

Comments (4)

jcupitt avatar jcupitt commented on August 18, 2024

Hello @Rjaat, I'd guess your TIFF is not using 0-65535 for black to white. When it's converted to 8-bit PNG, it looks black but isn't.

You'd need to share a sample source image before anyone could say more.

Are you sure you need that huge overlap?

from pyvips.

Rjaat avatar Rjaat commented on August 18, 2024

Thanks @jcupitt for your reply.

png tile information:

Width	1280
Height	1280
Data type	UInt16 - Sixteen bit unsigned integer
GDAL Driver Description	PNG

While making chunk of 4 band 16bit images the png tiles also generated in 16bit format which is not being rendered by openseadragon viewer. The same is also true when I have 3 band 16 bit image.

In another scenario where I have 8 bit RGB images everything works fine.

Yes, we need 50% overlap in our scenario

from pyvips.

jcupitt avatar jcupitt commented on August 18, 2024

As I said, it seems to work for me. You need to share a sample image so I can try to reproduce your problem.

For example, I can take this sample RGBA image:

biglion

Make a 16-bit, four band TIFF like this:

vips colourspace biglion.png x.tif rgb16

dzsave like this:

vips dzsave x.tif x --suffix .png --tile-size 640 --overlap 320

And I see tiles like this:

$ vipsheader x_files/11/1_1.png 
x_files/11/1_1.png: 1280x1280 ushort, 4 bands, rgb16, pngload

1_1

Which seems correct.

from pyvips.

jcupitt avatar jcupitt commented on August 18, 2024

Oh, do you want it to write 8-bit PNG tiles? You need to convert before dzsave, perhaps:

image = pyvips.Image.new_from_file(image_path, access='sequential')

image \
    .colourspace('srgb') \
    .dzsave(
        "basename",  # Base name for the output files
        suffix=".png",  # Sets the format of the tiles; use '.jpg' for JPEG tiles
        overlap=320,  # The overlap between tiles; adjust as necessary
        tile_size=640  # The size of each tile in pixels
    )

Are you sure you need random? I think sequential should work, even with very large overlaps, and will be much faster.

from pyvips.

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.