4

I have a JPEG 2000 Image, and want to convert it to a simple JPEG image, so that it will be visible in all browsers.

I tried looking at PythonMagic. I downloaded it from here and installed it, but couldn't find any documentation, on how to use it.

I have already used PIL in the past, but it doesn't support JPEG 2000.

The process needs to run on Windows 2008 R2, with Python 2.7. If another Python version needs to be installed, I can do that as well.

Devdatta Tengshe
  • 4,015
  • 10
  • 46
  • 59
  • possible duplicate of [Converting .jpg images to .png](http://stackoverflow.com/questions/10759117/converting-jpg-images-to-png) – sashoalm Mar 12 '14 at 06:34
  • 4
    @sashoalm Not really a duplicate of that. PIL doesn't support JPEG2000, it appears. – mpenkov Mar 12 '14 at 06:36
  • @Devdatta you really need to be more specific with your question. What is the problem? Can you install PythonMagic? Can you use their examples? – mpenkov Mar 12 '14 at 06:38
  • @misha Then he should have pointed that out, and asked about just opening a JPEG2000 image. OP still didn't do his research before asking the question. – sashoalm Mar 12 '14 at 06:46
  • 1
    @sashoalm Which part of "How to convert a JPEG2000 to JPEG in Python?" in the title doesn't make it obvious that he's working with a JPEG2000 image? – mpenkov Mar 12 '14 at 06:48
  • 1
    @sashoalm: PIL doesn't support JPEG200, so this is not a duplicate of that question. – Devdatta Tengshe Mar 12 '14 at 06:50
  • @misha OP didn't say that at the time I posted the comment. Don't you think he should have bothered to mention it? He has edited his question since to add that bit of important information. – sashoalm Mar 12 '14 at 07:13
  • @sashoalm: I did not edit the Question title. You can check the Edit history. – Devdatta Tengshe Mar 12 '14 at 08:12
  • @DevdattaTengshe Yes, you edited the question to point out that PIL doesn't support JPEG2000. You should have pointed that out earlier, because that's what made your question not a duplicate. – sashoalm Mar 12 '14 at 08:25

1 Answers1

5

pgmagick Here is the python library which you looking for.

I tried and it does covert .jp2 to .jpeg format.

from pgmagick import Image

img = Image('CB_TM432.jp2') # Input Image
img.write('CB_TM432.jpeg')  # Output Image
Tanveer Alam
  • 5,185
  • 4
  • 22
  • 43