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

image.load could not handle 2 channels (grayscale + alpha) image when specify depth=3 #208

Open
rickerliang opened this issue Jan 1, 2017 · 2 comments

Comments

@rickerliang
Copy link

IMO, this can handle the same as depth=1, the code may be like this:

elseif chan == 2 then
   local imgrgb = img.new(3, img:size(2), img:size(3))
   local narrow = img:narrow(1,1,1)
   imgrgb:select(1, 1):copy(narrow)
   imgrgb:select(1, 2):copy(narrow)
   imgrgb:select(1, 3):copy(narrow)
   img = imgrgb

Is that correct? Thanks.

@soumith
Copy link
Member

soumith commented Jan 1, 2017

are you planning to ignore alpha in this case?

@rickerliang
Copy link
Author

um..I think if people specify depth = 3, it means ignoring the alpha channel ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants