Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageContainer2D renders RGB .png images in black and white #402

Closed
antrikshmisri opened this issue Mar 30, 2021 · 3 comments · Fixed by #398
Closed

ImageContainer2D renders RGB .png images in black and white #402

antrikshmisri opened this issue Mar 30, 2021 · 3 comments · Fixed by #398

Comments

@antrikshmisri
Copy link
Member

Description

The ImageContainer2D UI component renders any RGB image with .png extension in black and white.

Way to reproduce

  1. Imort ImageContainer2D from fury.ui
from fury.ui import ImageContainer2D
  1. Make a ImageContainer2D object
img = ui.ImageContainer2D(img_path="path_to_png_image",
                          position=(250, 250) , size=(500, 500))
  1. Add the component to the scene
current_size = (1000, 1000)
show_manager = window.ShowManager(size=current_size,
                                  title="Image")

show_manager.scene.add(img)
show_manager.start()

System Information:

{'fury_version': '0.7.0.post21+g0b160ec', 'pkg_path': 'D:\\pythonProjects\\fury\\fury', 'commit_hash': '0b160ecef6767054a6d8f5cafdf3e636925f917f', 'sys_version': '3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]', 'sys_executable': 'D:\\pythonProjects\\fury\\venv\\Scripts\\python.exe', 'sys_platform': 'win32', 'numpy_version': '1.19.5', 'scipy_version': '1.5.4', 'vtk_version': '9.0.1', 'dipy_version': '1.4.0'}

Screenshots:

Screenshot (177)

Conjecture:

I think the function in question is load_image. More specifically when the image is being rendered as a vtk type

@jhalak27
Copy link
Contributor

jhalak27 commented Apr 4, 2021

Hey, I reproduced the output with this code:

from fury import window, ui
img = ui.ImageContainer2D(img_path="dice.png",
                          position=(250, 250) , size=(500, 500))
                      
current_size = (1000, 1000)
show_manager = window.ShowManager(size=current_size,
                                  title="Image")

show_manager.scene.add(img)
show_manager.start()

I got the image in RGB. Couldn't find the issue you are referring to.

The output was:
Screenshot from 2021-04-04 17-37-37

@antrikshmisri
Copy link
Member Author

@jhalak27 Hmm, this weird I have tried this with many images and I get the same result i.e. a black and white image. Can you try it out with more examples? I am using this image.

@jhalak27
Copy link
Contributor

jhalak27 commented Apr 7, 2021

Tried this too. @antrikshmisri

Got this result.
Screenshot from 2021-04-07 17-58-42

@skoudoro skoudoro linked a pull request Jun 4, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants