From jeff at corrt.com Thu Jan 1 23:20:19 2004 From: jeff at corrt.com (Jeff Kunce) Date: Thu Jan 1 23:20:53 2004 Subject: [Image-SIG] PIL: jpeg comment In-Reply-To: <20031223221724.GA2701@nl.linux.org> Message-ID: <000601c3d0e7$c4aab350$b9c3930a@jjkc100> I don't know for sure, but try looking in the "app" attribute (a dictionary) of an image object. For example: im = Image.open('myimage.jpg') print im.app EXIF data is stored there, so maybe comments are, too --Jeff > -----Original Message----- > From: image-sig-bounces@python.org [mailto:image-sig-bounces@python.org] > On Behalf Of Gerrit Holl > Sent: Tuesday, December 23, 2003 4:17 PM > To: image-sig@python.org > Cc: python-list@python.org > Subject: [Image-SIG] PIL: jpeg comment > > Hi, > > how do I read a JPEG comment with the Python Imaging Library? > > yours, > Gerrit Holl. > > -- > Asperger's Syndrome - a personal approach: > http://people.nl.linux.org/~gerrit/english/ > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig From joelrodrigues at ifrance.com Thu Jan 1 02:12:10 2004 From: joelrodrigues at ifrance.com (Joel Rodrigues) Date: Fri Jan 2 02:14:57 2004 Subject: [Image-SIG] PIL: jpeg comment In-Reply-To: <20031223221724.GA2701@nl.linux.org> Message-ID: Hi, The best option in Python may be to use EXIF.py (& exiftool.py) from http://home.cfl.rr.com/genecash/digital_camera.html Cheers & Happy New Year ! - joel On Wednesday, December 24, 2003, at 03:47 , Gerrit Holl wrote: > Hi, > > how do I read a JPEG comment with the Python Imaging Library? > > yours, > Gerrit Holl. > > -- > Asperger's Syndrome - a personal approach: > http://people.nl.linux.org/~gerrit/english/ > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig > _____________________________________________________________________ Envie de discuter en "live" avec vos amis ? T閘閏harger MSN Messenger http://www.ifrance.com/_reloc/m la 1鑢e messagerie instantan閑 de France From fredrik at pythonware.com Fri Jan 2 12:12:27 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri Jan 2 12:12:38 2004 Subject: [Image-SIG] Re: PIL: jpeg comment References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> Message-ID: Jeff Kunce wrote: > I don't know for sure, but try looking in the "app" attribute (a > dictionary) of an image object. For example: > im = Image.open('myimage.jpg') > print im.app > EXIF data is stored there, so maybe comments are, too this has been added in 1.1.5, but earlier versions ignore the comment markers. here's a patch: ==== //modules/pil/PIL/JpegImagePlugin.py#6 - f:\pythonware\modules\pil\PIL\JpegImagePlugin.py ==== @@ -87,6 +89,15 @@ else: self.info["adobe_transform"] = adobe_transform +def COM(self, marker): + # + # Comment marker. Store these in the APP dictionary. + + s = self.fp.read(i16(self.fp.read(2))-2) + + self.app["COM"] = s # compatibility + self.applist.append(("COM", s)) + def SOF(self, marker): # # Start of frame marker. Defines the size and mode of the @@ -208,7 +219,7 @@ 0xFFFB: ("JPG11", "Extension 11", None), 0xFFFC: ("JPG12", "Extension 12", None), 0xFFFD: ("JPG13", "Extension 13", None), - 0xFFFE: ("COM", "Comment", Skip) + 0xFFFE: ("COM", "Comment", COM) } From cbass233 at yahoo.com Sat Jan 3 15:18:34 2004 From: cbass233 at yahoo.com (Chuck Bass) Date: Sat Jan 3 15:18:37 2004 Subject: [Image-SIG] Re: Image-SIG Digest, Vol 9, Issue 2 In-Reply-To: Message-ID: <20040103201834.38852.qmail@web13906.mail.yahoo.com> Is 1.1.5 released? I've found references on the web but no downloads. >> this has been added in 1.1.5, but earlier versions ignore the comment >> markers. here's a patch: __________________________________ Do you Yahoo!? Find out what made the Top Yahoo! Searches of 2003 http://search.yahoo.com/top2003 From smurf at smurf.noris.de Wed Jan 7 07:43:03 2004 From: smurf at smurf.noris.de (Matthias Urlichs) Date: Wed Jan 7 07:59:41 2004 Subject: [Image-SIG] Image parser bug (Debian Bug #176456) Message-ID: <20040107124303.GB3365@play.smurf.noris.de> Hi, from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=176456: > The attached test script and .png file demonstrate the bug: Image.open() > succeeds while ImageFile.Parser().feed(data) throws an IOError. > Seems like an upstream bug to me. > Anyway, here it is for Debian reference. I am the (new) maintainer of the python-imaging package for Debian, which basically packages PIL, and this problem is still unfixed. (I wonder if it has been reported in the first place.) Can somebody who knows more about PIL's internals look into this? Thanks! [ Please keep 176456@bugs.d.o in the Cc: when you reply. Thanks. ] -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de - - Keep on keepin' on. From hec.villafuerte at telgua.com.gt Thu Jan 8 11:39:01 2004 From: hec.villafuerte at telgua.com.gt (=?UTF-8?B?IkjDqWN0b3IgVmlsbGFmdWVydGUgRC4i?=) Date: Thu Jan 8 09:37:19 2004 Subject: [Image-SIG] Re: [Tutor] Converting to PDF In-Reply-To: References: Message-ID: <3FFD87A5.8020706@telgua.com.gt> Hi all! Danny was so right! This is a bug in PIL. I changed '/DctDecode' and '/DCTDecode' in PdfImagePlugin.py and it worked just fine! Thanks Danny and all you Python people. Hector Danny Yoo wrote: > >On Wed, 7 Jan 2004, [ISO-8859-1] "H?ctor Villafuerte D." wrote: > > >>Hi all, >>I'm trying to generate PDFs with this little script: >> >>-----SCRIPT------------------------- >>import fileinput, os, Image >> >>def get_calls(dir, file): >> im = Image.open(dir + file) >> im.save(dir + '_' + file, 'PDF') >> >>if __name__ == '__main__': >> dir = 'c:\\tmp\\scan\\' >> for x in os.listdir(dir): >> if x.split('.')[1] == 'jpg': >> print x >> get_calls(dir, x) >> > > >Hi Hector, > > >I looked into the PdfImagePlugin.py source from version 1.1.4 of the >Python Imaging Library, > > http://www.pythonware.com/products/pil/ > > >And you appear to have run into a bug in PIL! The code in question in >PIL/PdfImagePlugin.py is: > >### > if filter == "/ASCIIHexDecode": > ImageFile._save(im, op, [("hex", (0,0)+im.size, 0, None)]) > elif filter == "/DCTDecode": > ImageFile._save(im, op, [("jpeg", (0,0)+im.size, 0, im.mode)]) > elif filter == "/FlateDecode": > ImageFile._save(im, op, [("zip", (0,0)+im.size, 0, im.mode)]) > elif filter == "/RunLengthDecode": > ImageFile._save(im, op, [("packbits", (0,0)+im.size, 0, im.mode)]) > else: > raise ValueError, "unsupported PDF filter" >### > > >That block is within the _safe() function in PdfImagePlugin.py. But >there's only one block of code that assigns to this 'filter' variable: > >### > if im.mode == "1": > filter = "/ASCIIHexDecode" > config = "/DeviceGray", "/ImageB", 1 > elif im.mode == "L": > filter = "/DctDecode" > # params = "<< /Predictor 15 /Columns %d >>" % (width-2) > config = "/DeviceGray", "/ImageB", 8 > elif im.mode == "P": > filter = "/ASCIIHexDecode" > config = "/Indexed", "/ImageI", 8 > elif im.mode == "RGB": > filter = "/DCTDecode" > config = "/DeviceRGB", "/ImageC", 8 > elif im.mode == "CMYK": > filter = "/DCTDecode" > config = "/DeviceRGB", "/ImageC", 8 > else: > raise ValueError, "illegal mode" >### > > >'filter' here has three possible values: > > ['/ASCIIHexDecode', > '/DctDecode', > '/DCTDecode'] > > >Notice the case difference here between '/DctDecode' and '/DCTDecode'. >Python is case sensitive. This is a bad sign. *grin* > > >The block that we're running into problems with, the one that throws the >exception, checks for: > > ["/ASCIIHexDecode", > "/DCTDecode", > "/FlateDecode", > "/RunLengthDecode"] > > >It doesn't handle "/DctDecode"! Furthermore, there's no way 'filter' can >be '/RunLengthDecode', so there's some dead code here too. > >There's definitely a bug here. Send a holler out to the Python Imaging >Library folks. *grin* > > http://mail.python.org/mailman/listinfo/image-sig > >and get them to fix it so no one else runs into this. > > > >In the meantime, my best guess right now to fix the bug is to modify >PdfImagePlugin.py and switch over the '/DctDecode' string to '/DCTDecode' >and see if that clears up the problem. Unfortunately, I can't test this >hypothesis without a sample JPEG image. > > > > > >By the way: you may want use os.path.join() to join together the directory >name with the file name. The code in get_calls(): > > >>def get_calls(dir, file): >> im = Image.open(dir + file) >> im.save(dir + '_' + file, 'PDF') >> > >may not get the correct name of the directory, since the path separator >might be missing. > >I can see that you have hardcoded the path separator embedded in the 'dir' >directory name within your main program, but if you are using get_calls() >from another program, then there's no guarantee that the directory name >ends with the path separator character. > > > >Hope this helps! > > > > From wangshifang_2008 at yahoo.com.cn Wed Jan 7 19:42:15 2004 From: wangshifang_2008 at yahoo.com.cn (=?gb2312?q?=CA=BF=B7=BC=20=CD=F5?=) Date: Sun Jan 11 11:40:11 2004 Subject: [Image-SIG] problems with import Message-ID: <20040108004215.61524.qmail@web15308.mail.bjs.yahoo.com> Hi: when I type 1 import _imaging Traceback (most recent call last): File "", line 1, in ? ImportError: DLL load failed: 找不到指定的模块。 2 import Image im = Image.open("c:\powered1.jpg") im.show() Traceback (most recent call last): File "", line 1, in ? File "E:\PYTHON22\Lib\site-packages\PIL\Image.py", line 1192, in show _showxv(self, title, command) File "E:\PYTHON22\Lib\site-packages\PIL\Image.py", line 1739, in _showxv file = self._dump(format=format) File "E:\PYTHON22\Lib\site-packages\PIL\Image.py", line 410, in _dump self.load() File "E:\PYTHON22\Lib\site-packages\PIL\ImageFile.py", line 151, in load self.load_prepare() File "E:\PYTHON22\Lib\site-packages\PIL\ImageFile.py", line 206, in load_prepa re self.im = Image.core.new(self.mode, self.size) File "E:\PYTHON22\Lib\site-packages\PIL\Image.py", line 39, in __getattr__ raise ImportError("The _imaging C module is not installed") ImportError: The _imaging C module is not installed 3.sys.path: ['', 'E:\\PYTHON22\\lib\\site-packages\\Pythonwin', 'E:\\PYTHON22\\lib\\site-pac kages\\win32', 'E:\\PYTHON22\\lib\\site-packages\\win32\\lib', 'E:\\PYTHON22\\li b\\site-packages', 'E:\\Python22\\DLLs', 'E:\\Python22\\lib', 'E:\\Python22\\lib \\lib-tk', 'E:\\Python22', 'E:\\Python22\\lib\\site-packages\\Numeric', 'E:\\Pyt hon22\\lib\\site-packages\\PIL'] my _imaging.pyd is under : E:\Python22\Lib\site-packages\PIL what should i do? Thanks __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20040108/9b9c162d/attachment.html From fredrik at pythonware.com Sun Jan 11 14:50:02 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun Jan 11 14:53:23 2004 Subject: [Image-SIG] Re: problems with import References: <20040108004215.61524.qmail@web15308.mail.bjs.yahoo.com> Message-ID: wangshifang_2008@yahoo.com.cn wrote: > when I type > 1 import _imaging > Traceback (most recent call last): > File "", line 1, in ? > ImportError: DLL load failed: > 2 import Image > im = Image.open("c:\powered1.jpg") > im.show() > Traceback (most recent call last): ... > ImportError: The _imaging C module is not installed > what should i do? this page might help: http://effbot.org/zone/pil-imaging-not-installed.htm if not, the text after "DLL load failed" might contain the necessary clues. From fredrik at pythonware.com Sun Jan 11 14:53:05 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun Jan 11 15:00:18 2004 Subject: [Image-SIG] Re: Is 1.1.5 released? References: <20040103201834.38852.qmail@web13906.mail.yahoo.com> Message-ID: Chuck Bass wrote: > Is 1.1.5 released? I've found references on the web but no downloads. 1.1.5 is in "internal alpha", and will stay so for another month or two (while I'm getting up to speed at my new job). From ewc at axelero.hu Thu Jan 15 11:09:47 2004 From: ewc at axelero.hu (ewc@axelero.hu) Date: Thu Jan 15 11:09:44 2004 Subject: [Image-SIG] Incorrect PIL font handling Message-ID: <1286567754.20040115170947@axelero.hu> Hello, I have some problems with italic fonts. Some parts of some characters are missing. For example font ncenI24.pil (from pilfonts: http://effbot.org/downloads/pilfonts.zip). When I draw character 'f', the left bottom part of charter is missing (the right top part is OK). When I draw 'ff', the 1st f's left bottom and right top part is missing while the 2nd f's left bottom part is missing. I took a look into source codes and found, that if a character has pozition smaller than 0 (zero), in that case the hanging out part is cut off (in case of f 12 pixels). This was for the left side of characters. On the right side there is similar problem. I wrote a very dirty hack: a C function which returns the glyph object and also a C function which returns some glyph information (e.g. dx0, baseline). I wrote also a simple python script which draws characters by character basis. In this way I was able to make a workaround, but I don't like this hack. Could anybody take a look for this problem? Kind regards, Thomas ps: I used Imaging-1.1.4 and Python-2.3.3 From infoHaugen at golfgod.net Sun Jan 18 07:15:12 2004 From: infoHaugen at golfgod.net (Quest) Date: Sun Jan 18 11:54:36 2004 Subject: [Image-SIG] Info regarding vigra Message-ID: how Vigra? works. So you can better understand, what Vigra can do for you. If you are sensible about your health, reflect on what you can do for your seual health, to keep the chances that you will need Vigra as low as possible. fleecy connote Englewood, political. Inrease Seks Drive Bost Seual Performance Fuller & Harder Erecions Inrease Stamna & Endurance Quicker Rechages http://www.securemedpills.com/index.php?pid=pharmaboss combined denounces scrutiny, Morse. furnished outruns bricklayer, inhaler. Thanks, frightful From britney21Bundestag at yahoo.com Mon Jan 19 00:21:56 2004 From: britney21Bundestag at yahoo.com (Image-sig) Date: Mon Jan 19 05:24:34 2004 Subject: [Image-SIG] Fwd: Want to have S E X, 20 times a day ? Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20040119/9f86a81c/attachment.html From clean_actrepaying at wildmail.com Tue Jan 20 16:33:58 2004 From: clean_actrepaying at wildmail.com (Equest) Date: Tue Jan 20 09:06:04 2004 Subject: [Image-SIG] Don't get busted ! ! . . . . . . . . . aviary Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20040120/038cc9a6/attachment.html From francois.mourougaya at laposte.net Wed Jan 21 13:03:40 2004 From: francois.mourougaya at laposte.net (=?iso-8859-1?Q?Fran=E7ois_Mourougaya?=) Date: Wed Jan 21 12:40:05 2004 Subject: [Image-SIG] floodfill routine ? Message-ID: <01f501c3e048$e6d6a680$2831a7c2@EON.sp2mi.univ-poitiers.fr> Hi everyone, does anybody have a floodfill routine in python (i.e. takes a binary array and throws an array with labeled regions), that would not be too slow ? Thanks. Fran?ois Mourougaya PhD student, SIC-laboratory Poitiers-France From allaugh at wongfaye.com Wed Jan 21 05:32:48 2004 From: allaugh at wongfaye.com (Python-dev) Date: Thu Jan 22 08:31:53 2004 Subject: [Image-SIG] nesws regarding vigros Bretons Message-ID: simplest, How Vigras works. And you can better understand, what Vigras can do for you. If you are sensible about your health, reflect on what you can do for your seual health, to keep the chances that you will need Vigras as low as possible. dancers circuitous bleats, relented. http://www.effectiveherbs.com/index.php?pid=genviag Inrease Seks Drive Bost Seual Performance Fuller & Harder Erecions Inrease Stamna & Endurance Quicker Rechages conspire Syrianizes plucking, genders. Burch soles Georgia, prophetic. Happy holidays, Goethe From droyko at uottawa.ca Fri Jan 23 16:07:52 2004 From: droyko at uottawa.ca (Dominik Royko) Date: Fri Jan 23 16:07:28 2004 Subject: [Image-SIG] ImageFilter.MaxFilter and MedianFilter Message-ID: <40118D28.B3FD562D@uottawa.ca> I noticed that images filtered with ImageFilter.MedianFilter(3) differed from those filtered with ImageFilter.RankFilter(3,4). (Rank values seem to go from 0 to (size*2)-1). Further inspection reveals: >>> ImageFilter.MaxFilter(3).rank 2 >>> ImageFilter.MaxFilter(5).rank 4 >>> ImageFilter.MedianFilter(3).rank 1 >>> ImageFilter.MedianFilter(5).rank 2 Should these not be 4, 12, & 8, 24? Am I missing something? Suggested patch follows. Dominik Royko. --- PIL/ImageFilter.py 2002-11-17 13:55:42.000000000 -0500 +++ PIL-patch/ImageFilter.py 2004-01-23 15:27:16.000000000 -0500 @@ -92,7 +92,7 @@ class MedianFilter(RankFilter): def __init__(self, size=3): self.size = size - self.rank = size/2 + self.rank = (size*size)/2 ## # Min filter. Picks the lowest pixel value in a window with the given @@ -124,7 +124,7 @@ class MaxFilter(RankFilter): def __init__(self, size=3): self.size = size - self.rank = size-1 + self.rank = (size*size)-1 ## # Mode filter. Picks the most frequent pixel value in a box with the From ralucitrapnienoon at yahoo.co.uk Fri Jan 23 20:56:12 2004 From: ralucitrapnienoon at yahoo.co.uk (centiare) Date: Sat Jan 24 20:59:26 2004 Subject: [Image-SIG] vermicule Message-ID: <20040125015922.612B147FF41@pfepa.post.tele.dk> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20040124/295c93bb/attachment.html From fredrik at pythonware.com Sun Jan 25 16:37:46 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun Jan 25 16:38:31 2004 Subject: [Image-SIG] Re: ImageFilter.MaxFilter and MedianFilter References: <40118D28.B3FD562D@uottawa.ca> Message-ID: Dominik Royko wrote: > Am I missing something? the Rank and Mode filters were not supposed to ship with 1.1.4; they're not included in the changes document, they're not documented, they're not officially supported, and they don't work properly. (this is why the docs say "new in 1.1.5") From lists at andreas-jung.com Mon Jan 26 02:35:42 2004 From: lists at andreas-jung.com (Andreas Jung) Date: Mon Jan 26 02:35:48 2004 Subject: [Image-SIG] PIL Error in loadfat() Message-ID: <2147483647.1075106142@[192.168.0.102]> OleFileIO.py: def loadfat(self, header): # Load the FAT table. The header contains a sector numbers # for the first 109 FAT sectors. Additional sectors are # described by DIF blocks (FIXME: not yet implemented) sect = header[76:512] fat = [] for i in range(0, len(sect), 4): ix = i32(sect, i) if ix == 0xFFFFFFFEL or x == 0xFFFFFFFFL: ^^^^^^^^^^^^^^^^ should be 'ix' and not 'x' -aj From Chris.Barker at noaa.gov Mon Jan 26 12:54:22 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Jan 26 12:57:19 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> Message-ID: <4015544E.9080801@noaa.gov> HI all, is it possible , with {PIL (or any other Python-based tool) to do simple manipulations to a JPEG, without decompressing it. What I'm imagining is simply rotation and cropping, at the moment. My understanding of JPEG compression is that if you compress and de-compress multiple times, more information is lost each time. If I understand this right, it seems a shame to degrade an image just to rotate or crop it. As an example, I'm imagining a python version of jpegr jpegtrans/jpegcrop: http://sylvana.net/jpegcrop/ thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From digulla at hepe.com Mon Jan 26 13:24:40 2004 From: digulla at hepe.com (Aaron Optimizer Digulla) Date: Mon Jan 26 13:24:51 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: <4015544E.9080801@noaa.gov> References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> <4015544E.9080801@noaa.gov> Message-ID: <20040126182440.GA2661@sebigbos.hepe.com> On Mon, Jan 26, 2004 at 09:54:22AM -0800, Chris Barker wrote: > As an example, I'm imagining a python version of jpegr jpegtrans/jpegcrop: How about calling jpegtrans via system()? -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not the universe that's limited, it's our imagination. Follow me and I'll show you something beyond the limits." http://www.philmann-dark.de/ From Chris.Barker at noaa.gov Mon Jan 26 14:30:06 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Jan 26 14:33:00 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: <20040126182440.GA2661@sebigbos.hepe.com> References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> <4015544E.9080801@noaa.gov> <20040126182440.GA2661@sebigbos.hepe.com> Message-ID: <40156ABE.20602@noaa.gov> Aaron Optimizer Digulla wrote: > How about calling jpegtrans via system()? That's what I'm doing at the moment, but I'm hoping for a more self contained, cross platfrom approach. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From chris at cogdon.org Mon Jan 26 14:45:50 2004 From: chris at cogdon.org (Chris Cogdon) Date: Mon Jan 26 14:45:54 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: <4015544E.9080801@noaa.gov> References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> <4015544E.9080801@noaa.gov> Message-ID: <3E4CAE36-5038-11D8-8992-000A95E3823E@cogdon.org> On Jan 26, 2004, at 09:54, Chris Barker wrote: > My understanding of JPEG compression is that if you compress and > de-compress multiple times, more information is lost each time. If I > understand this right, it seems a shame to degrade an image just to > rotate or crop it. The way that I understand JPEG is that the encoding for any particular pixel depends on 'state' that is set up from the previous pixels. In other words, if you were to crop off 1 or 2 pixels at the left hand side of the image, all the following pixels MUST be re-encoded... which means you get the re-compression that you were trying to avoid. Doubly so for rotations. In my view, JPEG images were never intended to be re-edited. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From smurf at smurf.noris.de Mon Jan 26 15:35:05 2004 From: smurf at smurf.noris.de (Smurf) Date: Mon Jan 26 15:36:41 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: <3E4CAE36-5038-11D8-8992-000A95E3823E@cogdon.org> References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> <4015544E.9080801@noaa.gov> <3E4CAE36-5038-11D8-8992-000A95E3823E@cogdon.org> Message-ID: <20040126203504.GA18886@server.smurf.noris.de> Hi, Chris Cogdon: > The way that I understand JPEG is that the encoding for any particular > pixel depends on 'state' that is set up from the previous pixels. In > other words, if you were to crop off 1 or 2 pixels at the left hand > side of the image, all the following pixels MUST be re-encoded... which > means you get the re-compression that you were trying to avoid. > > Doubly so for rotations. > JPEG is based on 8x8 cells. (Hence the blocky artefacts.) So you can in fact chop them by 8-pixel boundaries, and 90-degree rotate them by swapping the coefficients in the individual blocks as well as the blocks themselves, and probably some other minor stuff. JPEG2000, now, that's a wholly different kettle of fish. -- Matthias Urlichs | noris network AG | http://smurf.noris.de/ From chris at cogdon.org Mon Jan 26 17:35:19 2004 From: chris at cogdon.org (Chris Cogdon) Date: Mon Jan 26 17:35:29 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: <20040126203504.GA18886@server.smurf.noris.de> References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> <4015544E.9080801@noaa.gov> <3E4CAE36-5038-11D8-8992-000A95E3823E@cogdon.org> <20040126203504.GA18886@server.smurf.noris.de> Message-ID: On Jan 26, 2004, at 12:35, Smurf wrote: > Hi, > > Chris Cogdon: >> The way that I understand JPEG is that the encoding for any particular >> pixel depends on 'state' that is set up from the previous pixels. In >> other words, if you were to crop off 1 or 2 pixels at the left hand >> side of the image, all the following pixels MUST be re-encoded... >> which >> means you get the re-compression that you were trying to avoid. >> >> Doubly so for rotations. >> > JPEG is based on 8x8 cells. (Hence the blocky artefacts.) > > So you can in fact chop them by 8-pixel boundaries, and 90-degree > rotate > them by swapping the coefficients in the individual blocks as well as > the blocks themselves, and probably some other minor stuff. I don't think it's as simple as that. Firstly, even within the 8x8 cells, you need to rotate THAT as an element, meaning the association within the surrounding pixels is changed. Secondly, there is SOME 'holistic information' kept from cell to cell, or at least across the entire picture; I've seen corrupted JPEGs where the 'base colour' after a particular point has gone wildly awry. So... while I think it's a great goal, I believe doing editing beyond simply adding or subtracting profile information cannot be achieved without decoding then encoding again. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From smurf at smurf.noris.de Mon Jan 26 20:44:34 2004 From: smurf at smurf.noris.de (Smurf) Date: Mon Jan 26 20:50:22 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: References: <20031223221724.GA2701@nl.linux.org> <000601c3d0e7$c4aab350$b9c3930a@jjkc100> <4015544E.9080801@noaa.gov> <3E4CAE36-5038-11D8-8992-000A95E3823E@cogdon.org> <20040126203504.GA18886@server.smurf.noris.de> Message-ID: <20040127014434.GA21632@server.smurf.noris.de> Hi, Chris Cogdon: > >them by swapping the coefficients in the individual blocks as well as > >the blocks themselves, and probably some other minor stuff. > > I don't think it's as simple as that. > > Firstly, even within the 8x8 cells, you need to rotate THAT as an > element, meaning the association within the surrounding pixels is > changed. > That's what I believe I said. > So... while I think it's a great goal, I believe doing editing beyond > simply adding or subtracting profile information cannot be achieved > without decoding then encoding again. > jpegtools can do it, so it's evidently possible. (I didn't say it was easy. :- / ) -- Matthias Urlichs | noris network AG | http://smurf.noris.de/ From areopagus125 at yahoo.com Wed Jan 28 01:34:30 2004 From: areopagus125 at yahoo.com (David Smith) Date: Wed Jan 28 01:34:34 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: Message-ID: <20040128063430.75888.qmail@web12208.mail.yahoo.com> > >> In other words, if you were to crop off 1 or 2 > pixels at the left hand > >> side of the image, all the following pixels MUST be re-encoded... > >> which > >> means you get the re-compression that you were trying to avoid. True. > >> Doubly so for rotations. If the image is rotated 90 degrees CCW, the new horizontal coefficients are the old vertical, while the new vertical coefficients have to encode a mirror reversal of the old horizontal coefficients. I don't know whether this can be done without changing quantized coefficients. > Secondly, there is SOME 'holistic information' kept > from cell to cell, > or at least across the entire picture; I've seen > corrupted JPEGs where > the 'base colour' after a particular point has gone > wildly awry. That's true of any losslessly compressed file that gets corrupted in transmission. Jpeg's information loss consists of quantizing and thresholding the coefficients in the 8x8 block. The compression (entropy encoding) of those coefficients (which uses context from previously encoded blocks) proceeds without further loss. HTH, but I don't claim to be an expert. David Smith __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ From areopagus125 at yahoo.com Wed Jan 28 01:42:46 2004 From: areopagus125 at yahoo.com (David Smith) Date: Wed Jan 28 01:42:56 2004 Subject: [Image-SIG] Manipulating JPEGs w/out decompressing? In-Reply-To: <20040128063430.75888.qmail@web12208.mail.yahoo.com> Message-ID: <20040128064246.80889.qmail@web12207.mail.yahoo.com> --- David Smith wrote: > > >> Doubly so for rotations. > > If the image is rotated 90 degrees CCW, the new > horizontal coefficients are the old vertical, while > the new vertical coefficients have to encode a > mirror > reversal of the old horizontal coefficients. I > don't > know whether this can be done without changing > quantized coefficients. Come to think of it, mirror reversal causes 1-d DCT coefficients to be negated, suggesting rotation can be done without further loss. But 2-d coeffs, I'm still not sure. David Smith __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ From EGRAHAM at supernet.com Fri Jan 30 04:37:55 2004 From: EGRAHAM at supernet.com (Emmett Sabo) Date: Fri Jan 30 20:37:19 2004 Subject: [Image-SIG] Re [10]: Message-ID: <4348703306.62522302125023@supernet.com> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20040130/29a48b4d/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 3128 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20040130/29a48b4d/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 81 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20040130/29a48b4d/attachment-0001.gif From CGStartup at earthlink.net Sat Jan 31 11:23:51 2004 From: CGStartup at earthlink.net (Stan Schwartz) Date: Sat Jan 31 11:24:04 2004 Subject: [Image-SIG] Programmers Wanted for Computer Graphics Startup Near Philadelphia Message-ID: My name is Stan Schwartz, and I'm a University of Pennsylvania Ph.D. and an independent inventor. I'm submitting two computer graphics patents to the USPTO during the next several weeks. Technologies derived from these patents have application in several different market segments, including still image photomanipulation, movie special effects and post-production, web animation, and video games. I'm developing and marketing one or more of the applications through a startup company. I've produced demo output that clearly demonstrates the viability of my approaches, which I've been showing to potential licensees and investors. This demo output is currently being generated through a loosely connected series of scripts. To be productized the scripts will need to be recoded into standalone "industrial strength" applications that are much faster, bullet-proof, and that have slick GUIs. I'm looking for a lead/senior programmer to participate in and organize the implementation side of the startup and probably one or more junior programmers. Successful candidates for the programming team should have some to many of the following skills/characteristics: Extensible knowledge of/comfort with math, as exemplified by one or more of: Computer vision training/experience - feature location/ extraction, motion estimation, object recognition; Image processing training/experience - you know what a convolution kernel is; you've implemented a morphing algorithm; Linear algebra training/experience - matrix manipulation, familiarity with numeric computation packages, such as Numerical Python, or equivalent; Art/math programming play, mathematical visualization; 3D modeling, especially for character animation, especially if you've hacked/manipulated low-level 3D data representations in a variety of formats; GUI design/building, graphic design training a plus; Analysis of algorithms; C/C++, Linux/Unix a plus; (Note that I did most of the scripting mentioned above in Python through PIL and Numerical Python and would consider doing as much as we can of this in Python.) Startup and/or major fielded product development experience required for the lead/senior programmer, a plus for juniors; Within commuting distance of Philadelphia - we may move and/or outsource, but this is where/how we'll start; Relevant educational background is a plus, but I'm more interested in what you can demonstrate to me that you know, can do, and have done, than what you've formally studied; Intellectual flexibility, creativity, and ability to work and brainstorm collaboratively; Open-ended time commitment - After growing this, I have additional ideas in the queue that could be spun off into future products; and Demonstrable artistic skills and training in figurative painting, sculpture, and/or life-drawing are a plus. We have access to seed capital, and we'd prefer if participants accept some portion of salary as equity in our venture. If you're interested in participating, send me a cover letter and resume at cgstartup@earthlink.net. I'm willing to show you the demo and provide more details about the technology, although first you'll have to sign a non-disclosure agreement. The demo can also be posted temporarily to the web for online viewing, accompanied by an explanatory phone call. For Investors/Licensees: If you're a potential investor in the startup or a representative of a company that is potentially interested in licensing one of the applications and are interested in seeing the demo and hearing a description of the technologies, also under conditions of non-disclosure, please let me know through the means described above. Thanks for your time, Stan P.S. Some examples of my Python work with images, although not directly related to this venture are at and .