indus / kubi Goto Github PK
View Code? Open in Web Editor NEWa fast and flexible cubemap generator
License: MIT License
a fast and flexible cubemap generator
License: MIT License
Testet on MacOS, Python installed by Homebrew:
/opt/homebrew/bin/kubi -co layout=iiif static/images/FW-Handeln-000.jpg test
Traceback (most recent call last):
File "/opt/homebrew/bin/kubi", line 8, in <module>
sys.exit(run())
^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/kubi/kubi.py", line 347, in run
main(sys.argv[1:])
File "/opt/homebrew/lib/python3.11/site-packages/kubi/kubi.py", line 343, in main
kubi(args)
File "/opt/homebrew/lib/python3.11/site-packages/kubi/kubi.py", line 227, in kubi
mapim.write_to_file(f'{dst}_{fn}{dst_ext}', **args.co)
File "/opt/homebrew/lib/python3.11/site-packages/pyvips/vimage.py", line 804, in write_to_file
return pyvips.Operation.call(name, self, filename,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pyvips/voperation.py", line 288, in call
raise Error('{0} does not support optional argument {1}'
pyvips.error.Error: VipsForeignSaveJpegFile does not support optional argument layout
It seems that pyvips
doesn't handle the supplied parameter. I'm not sure if it's related to the fact that I omitted some possible parameters. If that's the case there is a sanity check missing.
As far as I can see and remember from working wit vips
directly the layout
option needs to be passed to dzsave
...
The warning I got:
GLib-GObject-WARNING **: 06:08:26.898: value "16384" of type 'gint' is invalid or out of range for property 'tile-size' of type 'gint'
The command I used:
kubi -s 16384 -co tile_size=16384 -co depth=onetile -co overlap=0 -co layout=google -co suffix=.png -f l r u d f b originalFile.png englishHasStopped.dz
My image file was 65,536 * 32,768 (2^14 * 2^13)
Using large file sizes up to this point seems to be completely fine, so does the output for smaller tiling, as a tile size of 8192 would work just fine.
Despite the bug (which is kinda ridiculous and possibly just unintended use): Massive respect for writing the only software that could handle such large files that I could find!
Hello,
After installing kubi with pip I'm unable to run any commands because of the following error :
`ModuleNotFoundError: No module named '_libvips'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\Scripts\kubi.exe_main.py", line 7, in
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\kubi\kubi.py", line 347, in run
main(sys.argv[1:])
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\kubi\kubi.py", line 343, in main
kubi(args)
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\kubi\kubi.py", line 38, in kubi
import pyvips
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvips_init.py", line 70, in
gobject_lib = ffi.dlopen(_gobject_libname)
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\cffi\api.py", line 150, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\cffi\api.py", line 832, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\Arthur\AppData\Local\Programs\Python\Python310\lib\site-packages\cffi\api.py", line 827, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library 'libgobject-2.0-0.dll': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libgobject-2.0-0.dll'`
I'm using python 3.10
Any suggestions?
thanks
How we can improve the image quality of tiles? right now it seems it is degrading the quality. even though we have tried 100% in Q parameter.
Let me know what am i doing wrong?
kubi -s 2048 -co tile_size=512 -co depth=onetile -co overlap=0 -co layout=google -co suffix=.jpg[Q=75] -f r l u d f b srcfile dstfile.dz
it seems tiles are generated with jpg thats why? @indus
Great library, thank you.
When I pass co arguments on linux and mac, Pyvips fails. Mac and linux.
Any tips greatly appreciated.
kubi -r lbb -f nx px py ny nz pz test.jpg test_out.jpg -co overlap=0
Traceback (most recent call last):
File "/usr/local/bin/kubi", line 33, in <module>
sys.exit(load_entry_point('kubi', 'console_scripts', 'kubi')())
File "/usr/local/lib/python3.9/site-packages/kubi/kubi.py", line 343, in run
main(sys.argv[1:])
File "/usr/local/lib/python3.9/site-packages/kubi/kubi.py", line 339, in main
kubi(args)
File "/usr/local/lib/python3.9/site-packages/kubi/kubi.py", line 225, in kubi
mapim.write_to_file(f'{dst}_{fn}{dst_ext}', **args.co)
File "/usr/local/lib/python3.9/site-packages/pyvips/vimage.py", line 804, in write_to_file
return pyvips.Operation.call(name, self, filename,
File "/usr/local/lib/python3.9/site-packages/pyvips/voperation.py", line 288, in call
raise Error('{0} does not support optional argument {1}'
pyvips.error.Error: VipsForeignSaveJpegFile does not support optional argument overlap
kubi -r lbb -f nx px py ny nz pz test.jpg test_out.jpg -co jpg
Traceback (most recent call last):
File "/usr/local/bin/kubi", line 33, in <module>
sys.exit(load_entry_point('kubi', 'console_scripts', 'kubi')())
File "/usr/local/lib/python3.9/site-packages/kubi/kubi.py", line 343, in run
main(sys.argv[1:])
File "/usr/local/lib/python3.9/site-packages/kubi/kubi.py", line 339, in main
kubi(args)
File "/usr/local/lib/python3.9/site-packages/kubi/kubi.py", line 225, in kubi
mapim.write_to_file(f'{dst}_{fn}{dst_ext}', **args.co)
File "/usr/local/lib/python3.9/site-packages/pyvips/vimage.py", line 804, in write_to_file
return pyvips.Operation.call(name, self, filename,
File "/usr/local/lib/python3.9/site-packages/pyvips/voperation.py", line 288, in call
raise Error('{0} does not support optional argument {1}'
pyvips.error.Error: VipsForeignSaveJpegFile does not support optional argument compression
Hey! Excited to use this! Unfortunately, when I run it on the latest version of MacOS (2019 Intel MBP), I get this error regardless of the input params:
kubi <myFile.jpg> <myFileCM.jpg>
results in:
UnboundLocalError: local variable 'pyvips' referenced before assignment
I made sure to install all of the related deps. I'm wondering if there is a step I'm missing?
tiles generated by kubi is not supported in marzipano viewer. the reason behind this is, z index starts from 0 in the tiling of kubi, however marzipano requires from 1.
Hi,
I have installed Kubi with python 3.6 and libvips by following this guide (https://tufora.com/tutorials/linux/general/install-vips-vips-tools-and-vips-devel-libvips-on-centos-7)
If i run kubi command in terminal, it is working fine.
However, when i run it in shell script it is having problem to load libvips.so.42
Is it some path setup missing in my shell script? Hope you can enlighten me on this.
Thanks.
Error Output: ================
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/pyvips/__init__.py", line 19,
in import _libvips ModuleNotFoundError: No module named '_libvips' During handling of the above exception,
another exception occurred: Traceback (most recent call last): File "/usr/local/bin/kubi",
line 33, in sys.exit(load_entry_point('kubi==0.1.4', 'console_scripts', 'kubi')()) File "/usr/local/lib/python3.6/site-packages/kubi/kubi.py",
line 335, in run main(sys.argv[1:]) File "/usr/local/lib/python3.6/site-packages/kubi/kubi.py",
line 331, in main kubi(args) File "/usr/local/lib/python3.6/site-packages/kubi/kubi.py",
line 38, in kubi import pyvips File "/usr/local/lib/python3.6/site-packages/pyvips/__init__.py",
line 71, in vips_lib = ffi.dlopen(_vips_libname) File "/usr/local/lib64/python3.6/site-packages/cffi/api.py",
line 150, in dlopen lib, function_cache = _make_ffi_library(self, name, flags) File "/usr/local/lib64/python3.6/site-packages/cffi/api.py",
line 832, in _make_ffi_library backendlib = _load_backend_lib(backend, libname, flags) File "/usr/local/lib64/python3.6/site-packages/cffi/api.py",
line 827, in _load_backend_lib raise OSError(msg) OSError: cannot load library 'libvips.so.42': /lib64/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libvips.so.42'
platform: macOS 11.6
python version: 3.8.5
vips version: 8.12.2
pyvips version: 2.2.1
numpy version: 1.23.1
kubi version: master
First of all, thanks for developing kubi - it's super useful, especially for generating cube map images for use with Marzipano. I keep encountering a problem with all the images I try as inputs - the output +Y image always seemes to have a 1-pixel wide black line down the middle from the top to the center of the image, like in the image below:
I think I've tracked the problem down to the way the x,y coordinates for the mapping image (for use with the vips mapim function) are generated. It seems that some of the pixel coordinates fall outide the bounds of the input image. Given an input image with dimentions of 4096x2049 pixels, the mapping for face +Y tried to access pixels at x coordinates 4096. Since image dimentions are zero-based, the maximum x coordinate would be 4095.
I shifted the linspace sample values by half a step on line 64, and this seems to have fixed the issue, and cube edges seem to line up more precisely now too:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.