![]() imwrite thus assumes to get a plain old ndarray and has to look elsewhere for input metadata such as the colorspace being used. In v3 we have to rely on the user specifying the correct mode because v3 treats metadata and image data separately. The technical reason (if that is interesting to you) is, because img's data buffer will be interpreted as a c-contiguous array of shape (44, 120, 3) while actually being c-contiguous and of shape (44, 120, 4), which introduces an offset that renders as the artifact you see in the result image. The corruption happens when we call (img, mode=.) with mode="RGB" (default) under the hood. V3 switches the default writing mode to RGB, because it's more popular than RGBA. Yes this is expected since that call violates assumptions. OT: I'm surprised that imageio.v3.imwrite("test2.png", img) stores a broken image, but maybe that's expected. I will have a think if this can easily be integrated into the current v2 API, or if it will simply fix itself as we transition into v3. Indeed, I can get the desired image if I Awesome, then we have a fix. _meta)įile "C:\Users\Sebastian\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\Image.py", line 2240, in save save_handler( self, fp, filename)įile "C:\Users\Sebastian\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\PngImagePlugin.py", line 1312, in _save raise OSError( "cannot use transparency for this mode")Ĭonsidering that the PR branch does the right thing, the new (v3) pillow plugin should fix this. _append_data( self, im, meta)įile "C:\Users\Sebastian\Documents\Coding-Projects\imageio\imageio\plugins\pillow_legacy.py", line 379, in _append_data img. _append_data( im, total_meta)įile "C:\Users\Sebastian\Documents\Coding-Projects\imageio\imageio\plugins\pillow_legacy.py", line 457, in _append_data PillowFormat. append_data( image)įile "C:\Users\Sebastian\Documents\Coding-Projects\imageio\imageio\core \format.py", line 492, in append_data return self. write( im, ** kwargs)įile "C:\Users\Sebastian\Documents\Coding-Projects\imageio\imageio\core\imopen.py", line 303, in write writer. imread( "")įile "", line 1, in File "C:\Users\Sebastian\Documents\Coding-Projects\imageio\imageio\core \functions.py", line 195, in imwrite return file. OSError: cannot use transparency for this mode Raise OSError("cannot use transparency for this mode") Img.save(self._fp, format=_id, **self._meta)įile "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/PIL/Image.py", line 2240, in saveįile "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/PIL/PngImagePlugin.py", line 1312, in _save PillowFormat.Writer._append_data(self, im, meta)įile "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/imageio/plugins/pillow_legacy.py", line 379, in _append_data One thing in this regard helping is using a logarithmic depth buffer and a minimal offset increasing by distance - but remember enabling logarithmicDepthBuffer for the renderer will also come with a cost and rather pays off when your scene renders large distances and therefore requires it.File "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/imageio/core/functions.py", line 195, in imwriteįile "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/imageio/core/imopen.py", line 303, in writeįile "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/imageio/core/format.py", line 492, in append_dataįile "/home/tom/temp/without_ssp/lib64/python3.9/site-packages/imageio/plugins/pillow_legacy.py", line 457, in _append_data To get overlapping on the edges/cliffs like in your first picture you can use a set of 4 tiles wich have only 1 side with the grass overlapping each.Īnother approach is using decals, for decals there are a couple methods, but archiving transparent ones which aren’t projected on a geometry is harder as you’re again have to avoid z-fighting. You can set alphaTest: 0.5 in your material to reduce the black border, but it won’t help with z-fighting which will be only a little less visible as the colors are similar. What you see there is z-fighting, so what you’re trying can be better archived by keeping those grassy details inside your tile - but making it seamless to the neighbour tiles which is perfectly possible for your pattern. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |