Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 735881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:32:27+00:00 2026-05-14T07:32:27+00:00

I have an image . I want to resize it using PIL, but it

  • 0

I have an image. I want to resize it using PIL, but it comes out
like this.

Even without a resize, it still messes up the colour.

Minimal code:

from PIL import Image
import os
import urllib
import webbrowser

orig_url = 'http://mercedesclub.org.uk/images/stackoverflow-question/least-popular-colours-_-500-x-500.jpg'
temp_fn, _ = urllib.urlretrieve(orig_url)

im = Image.open(temp_fn)

fn = os.tempnam() + '.jpg'
im.save(fn)
webbrowser.open(fn)

I’ve tried Image.open(temp_fn).convert(format) with ‘RGB’, ‘CMYK’ and ‘L’ as formats, but still get weirdly coloured or grey results.

When I load the image from my hard drive and I can see:

>>>im.info  
{'adobe': 100, 
'progression': 1, 
'exif': 'Exif\x00\x00MM\x00*...\x7f\xff\xd9', 
'adobe_transform': 100}

>>>im.format  
'JPEG'  

>>>im.mode  
'CMYK'  

>>> im._getexif()
{40961: 65535, 40962: 500, 40963: 500, 296: 2, 34665: 164, 274: 1, 305: 'Adobe Photoshop CS Macintosh', 306: '2010:02:26 12:46:54', 282: (300, 1), 283: (300, 1)}

Thanks and let me know if you need any more data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:32:28+00:00Added an answer on May 14, 2026 at 7:32 am

    Following interjay’s link, the problem was fixed by upgrading to PIL 1.1.7. This includes an update to allow CMYK jpegs created by Photoshop to work correctly. But don’t blame PIL, as Fredrik Lundh puts it:

    “CMYK in JPEG is one big mess, mainly because Adobe got it wrong in Photoshop many years ago.”

    By the way, you can find which version of PIL you have by doing:

    >>> Image.VERSION  
    '1.1.7'  
    

    Update: to make the resulting image display in IE you need to add .convert('RGB') so that you’re outputting in standard jpeg RGB format, not CMYK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this div: <div class=inauguration-image> I do not want this text to display,
I have image data and i want to get a sub image of that
I have: image 1:Many imageToTag Many:1 tag I want to issue a query that
I have an image and on it are logos (it's a map), I want
I have an object of the type System.Drawing.Image and want to make every pixel
I have a rootfs boot image that I want to test by mounting on
I have a JPEG image (actually a BLOB in a database) which I want
I have a webpage where I want the user to see a new image
I have a CALayer with some image contents. When a button touched, I want
Simple idea: I have two images that I want to merge, one is 500x500

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.