Skip to content

RGB image is flipped a different way depending on whether it is PNG or JPG #101

Closed
@astrofrog

Description

@astrofrog

If I run the following example

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(1,2,1)
image = plt.imread('2mass_rgb.png')
ax.imshow(image, origin='upper', extent=[0.5,723.5,0.5,724.5])

ax = fig.add_subplot(1,2,2)
image = plt.imread('2mass_rgb.jpg')
ax.imshow(image, origin='upper', extent=[0.5,723.5,0.5,724.5])

fig.savefig('rgb.png')

the left and right hand subplots show the RGB image flipped a different way. This does not happen if I use PIL to read in the image using Image.open, so presumably it is a bug in imread? The files I am using can be found here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions