Giter VIP home page Giter VIP logo

Comments (15)

jcupitt avatar jcupitt commented on June 19, 2024 1

Hello, you can't write SVS, it's a read-only format.

Do you want a command-line? Try:

vips black x.tif 500000 100000

It'll obviously take a while!

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024 1

Yes by doing pyramid=True. However is there any way to only restrict the number of layers alongwith pyramid? It gives 10 layers by default.

from pyvips.

jcupitt avatar jcupitt commented on June 19, 2024

Oh, sorry, pyvips. Try:

import pyvips

huge_image = pyvips.Image.black(500000, 100000)
huge_image.write_to_file("x.tif")

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

Thanks for the quick reply. I have a numpy array of size that big. I want to write it as to be read compatibly by openslide which leaves me with an option of only tiff images.

from pyvips.

jcupitt avatar jcupitt commented on June 19, 2024

You can go numpy -> vips like this:

https://github.com/libvips/pyvips/blob/master/examples/pil-numpy-pyvips.py

You probably saw.

I would save as a tiled jpeg bigtiff, so:

huge_image.tiffsave("x.tif", tile=true, compression=jpeg, bigtiff=true)

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

I got this error:
I used numpy to vips conversion and wrote it into pyimg. sourcenorm is an numpy array for a color image. Here s is a string containing path for saving the .tif extension file.

pyimg = numpy2vips(sourcenorm)
 pyimg.tiffsave(s, tile=True, compression='jpeg', bigtiff=True)
  File "/home/deepakanand/.local/lib/python2.7/site-packages/pyvips/vimage.py", line 799, in call_function
    return pyvips.Operation.call(name, self, *args, **kwargs)
  File "/home/deepakanand/.local/lib/python2.7/site-packages/pyvips/voperation.py", line 132, in call
    op = Operation.new_from_name(operation_name)
  File "/home/deepakanand/.local/lib/python2.7/site-packages/pyvips/voperation.py", line 60, in new_from_name
    raise Error('no such operation {0}'.format(operation_name))
pyvips.error.Error: no such operation tiffsave
  VipsOperation: class "tiffsave" not found

from pyvips.

jcupitt avatar jcupitt commented on June 19, 2024

Looks like your libvips has been built without tiff support. Did you make it yourself? Check the output of libvips configure and make sure you have the libtiff headers.

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

Thanks for such response.
Can you provide me a stepwise instruction for rebuilding it. I was not able to build it as one go. There were errors. However, later it started to work.
I am running Ubuntu 16.04, python 2.7.

from pyvips.

jcupitt avatar jcupitt commented on June 19, 2024

There's a chapter in the docs:

https://libvips.github.io/libvips/install.html#building-libvips-from-a-source-tarball

it's like building any linux project.

but are you sure you need to build libvips? The version that's included with Ubuntu 16.04 should work.

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

If libvips is already there then how to add support for Tiffsave.

from pyvips.

jcupitt avatar jcupitt commented on June 19, 2024

Because you have installed your own libvips which does not have tiff support. Remove it and install the Ubuntu one instead.

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

Cool! I will do it and get back to you. Thanks again. You are one of the most active guys in handling issues.

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

I was able to write the image as .tif format but openslide fails to read it. Do I need to read the created files using vips only?

from pyvips.

deepakanandece avatar deepakanandece commented on June 19, 2024

Openslide recognizes the file if it has multiple layers. Thanks a lot.

from pyvips.

jcupitt avatar jcupitt commented on June 19, 2024

Ah OK, good to know. That's with pyramid=True I guess?

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.