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

Add test cases for grayscale JPEG #88

Open
cdeil opened this issue Jul 24, 2017 · 3 comments
Open

Add test cases for grayscale JPEG #88

cdeil opened this issue Jul 24, 2017 · 3 comments
Assignees
Milestone

Comments

@cdeil
Copy link
Contributor

cdeil commented Jul 24, 2017

Just now I noticed that there are HiPS JPEG tiles that are grayscale, i.e. don't have the 3 color channels. Example:

>>> from skimage import io
>>> io.imread('../hips-extra/datasets/samples/IRAC4/Norder3/Dir0/Npix299.jpg').shape
(512, 512)

I think that currently we don't process those correctly, because here we assume with JPEG we always have 3 channels:

return height, width, 3

So the task here is to add test cases for the already parameterized tests using this example, in test_tile.py and test_draw.py, and then possibly to fix the handling of the shape to return a 2-dim image without color channels in that case.

@cdeil cdeil added this to the 0.2 milestone Jul 24, 2017
@cdeil
Copy link
Contributor Author

cdeil commented Jul 26, 2017

So as mentioned on hipspy/hips-extra#6 (comment) this is actually a publicly available HiPS that people will want to use.

But I now get this:

>>> from skimage.io import imread
>>> imread('http://alasky.u-strasbg.fr/IRAC4/Norder3/Dir0/Npix0.jpg').shape
(512, 512, 3)
>>> imread('https://github.com/hipspy/hips-extra/raw/master/datasets/samples/IRAC4/Norder3/Dir0/Npix299.jpg').shape
(512, 512)

It looks like the tiles we have in hips-extra are different (single channel) from the ones on the CDS server (3 channel as for other JPEG).

@tboch - I'm assigning this issue to you: please clarify if we need to change our code to handle single-channel JPEG. And if it's not the case, then we should update the example dataset in hips-extra for IRAC4.

@cdeil cdeil assigned tboch and unassigned adl1995 Jul 26, 2017
@cdeil cdeil modified the milestones: 0.2, 0.3 Oct 28, 2017
@cdeil
Copy link
Contributor Author

cdeil commented Jan 8, 2019

@tboch - Can you please comment here? Are there JPEG HiPS tiles that are 2D, or are they always 3D with the RGB color channel?

@tboch
Copy link
Member

tboch commented Jan 8, 2019

@cdeil : the HiPS standard says nothing about the layout of the JPEG tiles, thus we should expect to have 3 channels or a single channel. I think most of the JPEP grayscale tiles are encoded on 3 channels nevertheless.

In the very case you mention, I'm quite surprised that we have a mix between 1-channel and 3-channels tiles.

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

No branches or pull requests

3 participants