RSS/Atom feed Twitter
Site is read-only, email is disabled

lossless cropping?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

24 of 25 messages available
Toggle history

Please log in to manage your subscriptions.

lossless cropping? zhangweiwu@realss.com 01 Feb 12:46
  lossless cropping? Sven Neumann 01 Feb 13:11
   lossless cropping? zhangweiwu@realss.com 01 Feb 15:28
    lossless cropping? Johan Vromans 02 Feb 09:24
     lossless cropping? Greg Chapman 02 Feb 10:13
      lossless cropping? Alexander Rabtchevich 02 Feb 10:26
       lossless cropping? Greg Chapman 02 Feb 10:49
        lossless cropping? Claus Cyrny 02 Feb 13:37
         lossless cropping? Alexander Rabtchevich 02 Feb 13:44
          lossless cropping? Greg Chapman 02 Feb 14:21
         lossless cropping? Jeffrey Brent McBeth 02 Feb 13:46
          lossless cropping? Vlasta 02 Feb 14:26
           lossless cropping? Ken Warner 02 Feb 19:23
     lossless cropping? Vlasta 02 Feb 10:53
      lossless cropping? zhangweiwu 18 Aug 16:57
   lossless cropping? zhangweiwu@realss.com 01 Feb 15:28
    lossless cropping? zhangweiwu@realss.com 01 Feb 16:12
  lossless cropping? zhangweiwu@realss.com 01 Feb 16:36
lossless cropping? Jernej Simon?i? 01 Feb 13:05
mailman.237521.1233498544.1... 07 Oct 20:19
  lossless cropping? Gary Collins 03 Feb 14:25
   lossless cropping? Claus Cyrny 03 Feb 15:34
    lossless cropping? David Hodson 04 Feb 09:29
     lossless cropping? Johan Vromans 04 Feb 22:09
      lossless cropping? zhangweiwu@realss.com 23 Mar 09:28
zhangweiwu@realss.com
2009-02-01 12:46:10 UTC (about 15 years ago)

lossless cropping?

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping? If not, what software (better has an GUI because I am not commandline guru) on Linux can be used to do lossless cropping?

Thanks.

Jernej Simon?i?
2009-02-01 13:05:09 UTC (about 15 years ago)

lossless cropping?

On Sun, 01 Feb 2009 19:46:10 +0800, zhangweiwu@realss.com wrote:

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping? If not, what software (better has an GUI because I am not commandline guru) on Linux can be used to do lossless cropping?

If you're talking about cropping JPEG files, then no - you'll have to find a specialized program for that (it would be very difficult to implement lossless JPEG operations in any image editor).

Sven Neumann
2009-02-01 13:11:28 UTC (about 15 years ago)

lossless cropping?

Hi,

On Sun, 2009-02-01 at 19:46 +0800, zhangweiwu@realss.com wrote:

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping?

GIMP doesn't know anything about JPEG images. The image is opened by a plug-in and the core only gets to see the decompressed image. So if you crop the image in GIMP, it will have to be recompressed when it is saved as JPEG again. The JPEG plug-in does a nice job at preserving as much of the JPEG compression settings as possible to minimize the defects introduced by the recompression. But you will get slightly better results with specialised software that works directly on the JPEG data.

Sven

zhangweiwu@realss.com
2009-02-01 15:28:42 UTC (about 15 years ago)

lossless cropping?

Sven Neumann schrieb:

Hi,

On Sun, 2009-02-01 at 19:46 +0800, zhangweiwu@realss.com wrote:

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping?

GIMP doesn't know anything about JPEG images. The image is opened by a plug-in and the core only gets to see the decompressed image. So if you crop the image in GIMP, it will have to be recompressed when it is saved as JPEG again. The JPEG plug-in does a nice job at preserving as much of the JPEG compression settings as possible to minimize the defects introduced by the recompression. But you will get slightly better results with specialised software that works directly on the JPEG data.

Hi. Thanks. You (and Jernej) wrote it very clear!

Can any recommend such an editor for lossless cropping & rotating, better even lossless resizing, if possible. Cropping, rotating and resizing are the only feature my user (not me) uses and my user wanted to have a GUI tool. If there isn't one but only commandline tools, then I'd see if I can re-use my tcl/tk skill to make an opensource tool for this.

zhangweiwu@realss.com
2009-02-01 15:28:57 UTC (about 15 years ago)

lossless cropping?

Sven Neumann schrieb:

GIMP doesn't know anything about JPEG images. The image is opened by a plug-in and the core only gets to see the decompressed image. So if you crop the image in GIMP, it will have to be recompressed when it is saved as JPEG again. The JPEG plug-in does a nice job at preserving as much of the JPEG compression settings as possible to minimize the defects introduced by the recompression. But you will get slightly better results with specialised software that works directly on the JPEG data.

Hi. Thanks. You (and Jernej) wrote it very clear!

Can any recommend such an editor for lossless cropping & rotating, better even lossless resizing, if possible. Cropping, rotating and resizing are the only feature my user (not me) uses and my user wanted to have a GUI tool. If there isn't one but only commandline tools, then I'd see if I can re-use my tcl/tk skill to make an opensource tool for this.

zhangweiwu@realss.com
2009-02-01 16:12:22 UTC (about 15 years ago)

lossless cropping?

zhangweiwu@realss.com schrieb:

Can any recommend such an editor for lossless cropping & rotating,

With the following googles that have corrected my stupid typos now I can get some information about lossless cropping and answer my own question:

http://sylvana.net/jpegcrop/ offer commandline tool for cropping an image.

Fotoview is GUI tool that can do lossless cropping, written in Delphi for Windows:
http://www.polamar.net/fotoview/index_e.htm

zhangweiwu@realss.com
2009-02-01 16:36:34 UTC (about 15 years ago)

lossless cropping?

zhangweiwu@realss.com schrieb:

what software (better has an GUI because I am not commandline guru) on Linux can be used to do lossless cropping?

A more complete answer to myself in case anyone needs it too:

Tools on Linux that can do loseless cropping:

Commandline tool:

jpegcrop and jpegtrans (part of libjpeg

GUI tool:

mapivi http://mapivi.sourceforge.net

And major Linux image viewers like gthumb, eog (eye of gnome), Gwenview all supports lossless flipping and rotating, but none declare supporting lossless cropping (among which eog I tried and truly not having cropping feature)

Johan Vromans
2009-02-02 09:24:20 UTC (about 15 years ago)

lossless cropping?

zhangweiwu@realss.com writes:

Can any recommend such an editor for lossless cropping & rotating, better even lossless resizing,

Lossless resizing? How do you envision that?

-- Johan

Greg Chapman
2009-02-02 10:13:33 UTC (about 15 years ago)

lossless cropping?

Hi,

On 02 Feb 09 08:24 Johan Vromans said:

Lossless resizing? How do you envision that?

1. Read the file
2. Separate image segment from, Comment, EXIF, IPTC, and other data segments
3. Delete just those bytes that refer to the unwanted parts of the image
4. Reassemble the file, with any required "housekeeping" bytes edited 5. Resave

As others have said - not something that the GIMP does.

Greg Chapman

Alexander Rabtchevich
2009-02-02 10:26:47 UTC (about 15 years ago)

lossless cropping?

I think you mix cropping and resizing :).

Greg Chapman wrote:

Hi,

On 02 Feb 09 08:24 Johan Vromans said:

Lossless resizing? How do you envision that?

1. Read the file
2. Separate image segment from, Comment, EXIF, IPTC, and other data segments
3. Delete just those bytes that refer to the unwanted parts of the image
4. Reassemble the file, with any required "housekeeping" bytes edited 5. Resave

As others have said - not something that the GIMP does.

Greg Chapman

Greg Chapman
2009-02-02 10:49:04 UTC (about 15 years ago)

lossless cropping?

Hi Alexander,

On 02 Feb 09 09:26 Alexander Rabtchevich said:

I think you mix cropping and resizing :).

I didn't mix them. I just assumed Johan had. Up till now this thread had been exclusively about cropping.

Greg Chapman

2009-02-02 10:53:04 UTC (about 15 years ago)
postings
2

lossless cropping?

Lossless resizing? How do you envision that?

-- Johan

while I have heard about possible plans about how to do lossless resizing from one of the JPEG guys, it would require extension of the standard and it would only be able to resize to 1/8, 2/8, 3/8, ... of the original size.

It does not really make much sense, resizing is destructive by nature and you usually resize picture to make the file physically smaller, which would not be possible if it were lossless.

BTW, I am author of a Windows application for lossless rotation, cropping, canvas extension and retouching called RealWorld Photos.

Claus Cyrny
2009-02-02 13:37:24 UTC (about 15 years ago)

lossless cropping?

Greg Chapman wrote:

Hi Alexander,

On 02 Feb 09 09:26 Alexander Rabtchevich said:

I think you mix cropping and resizing :).

I didn't mix them. I just assumed Johan had. Up till now this thread had been exclusively about cropping.

I have to admit that, after following this thread, I still have no idea what Zhang Wei Wu means by 'lossless 'cropping'. I understand' lossless compression', but cropping is by definition lossy (you remove part of the original image), so I don't know what 'lossless' means in this context.

Claus

Alexander Rabtchevich
2009-02-02 13:44:01 UTC (about 15 years ago)

lossless cropping?

I guess lossless means the remained part ot the image hasn't been re-encoded (it has the same jpg data as the original image).

Claus Cyrny wrote:

I have to admit that, after following this thread, I still have no idea what Zhang Wei Wu means by 'lossless 'cropping'. I understand' lossless compression', but cropping is by definition lossy (you remove part of the original image), so I don't know what 'lossless' means in this context.

Claus

Jeffrey Brent McBeth
2009-02-02 13:46:30 UTC (about 15 years ago)

lossless cropping?

On Mon, Feb 02, 2009 at 01:37:24PM +0100, Claus Cyrny wrote:

I have to admit that, after following this thread, I still have no idea what Zhang Wei Wu means by 'lossless 'cropping'. I understand' lossless compression', but cropping is by definition lossy (you remove part of the original image), so I don't know what 'lossless' means in this context.

I'm going to take a wild guess on this (not having read the rest of the thread). If you were to take a lossy format (say, mp3 or jpeg), and cut out portions of the data and then recompresses the remaining data, the data that remains gets refiltered and suffers more loss than that just due to the data cropped out. On the other hand, both mp3 and jpeg support something that could be termed lossless cropping as long as you cut on the data boundaries (packet in mp3, 8x8 block on jpeg) where the data you crop out obviously gets thrown out, but the remaining data does not get refiltered with its resulting additional informational loss.

Jeff

Greg Chapman
2009-02-02 14:21:24 UTC (about 15 years ago)

lossless cropping?

Hi,

On 02 Feb 09 12:44 Alexander Rabtchevich said:

I guess lossless means the remained part ot the image hasn't been re-encoded (it has the same jpg data as the original image).

That was what I understood when I made my initial reply. Hence I described the workings of a "jpeg file editor". Compare this with the GIMP, an "image editor".

In an image editor the image gets recreated from the data that is decompessed on loading the file. This reveals the imperfections of the missing data thrown away when it was initially saved (as one expected with a JPEG file). The edges of that lossy image are then removed and then the file re-saved. Saving creates a new file and compressing the image once more, causing still more data loss to the image.

The jpeg file editor simply chops out the unwanted chunks of the existing compressed code from the file and rewrites that to the disk. It does NOT re-compress the file, hence the process is lossless (In as much as it doesn't run a second compression on the original compressed (and and admittedly lossy) data).

Greg Chapman

2009-02-02 14:26:04 UTC (about 15 years ago)
postings
2

lossless cropping?

On Mon, Feb 02, 2009 at 01:37:24PM +0100, Claus Cyrny wrote:

I have to admit that, after following this thread, I still have no idea what Zhang Wei Wu means by 'lossless 'cropping'. I understand' lossless compression', but cropping is by definition lossy (you remove part of the original image), so I don't know what 'lossless' means in this context.

I'm going to take a wild guess on this (not having read the rest of the thread). If you were to take a lossy format (say, mp3 or jpeg), and cut out portions of the data and then recompresses the remaining data, the data that remains gets refiltered and suffers more loss than that just due to the data cropped out. On the other hand, both mp3 and jpeg support something that could be termed lossless cropping as long as you cut on the data boundaries (packet in mp3, 8x8 block on jpeg) where the data you crop out obviously gets thrown out, but the remaining data does not get refiltered with its resulting additional informational loss.

Jeff

Yes, that's it. When people talk about lossless jpeg modifications, in 99% they are referring to "elimination of cumulative losses introduced by repeated compression and decompression". (And the other 1% ... there is a kind of JPG-based format that is lossless, but there is almost not support for it in common applications and it has poor compression ratio and hence negates the advantage of classic JPG).

Ken Warner
2009-02-02 19:23:02 UTC (about 15 years ago)

lossless cropping?

This is a useful discussion. I make panoramas -- like scores of other. I usually first make a rather large pano as a tif and then down size it and compress it into a web friendly jpg file.

I have not been paying much attention to the relative sizes going from tif to resized jpg. I notice that sometimes I get odd banding artifacts that can show up as a Moire pattern while projecting a view from equirectangular to rectilinear.

In the future, I will be careful to resize the tif file into modulo 8 sizes. Does that make sense? It couldn't hurt.

Vlasta wrote:

On Mon, Feb 02, 2009 at 01:37:24PM +0100, Claus Cyrny wrote:

I have to admit that, after following this thread, I still have no idea what Zhang Wei Wu means by 'lossless 'cropping'. I understand' lossless compression', but cropping is by definition lossy (you remove part of the original image), so I don't know what 'lossless' means in this context.

I'm going to take a wild guess on this (not having read the rest of the thread). If you were to take a lossy format (say, mp3 or jpeg), and cut out portions of the data and then recompresses the remaining data, the data that remains gets refiltered and suffers more loss than that just due to the data cropped out. On the other hand, both mp3 and jpeg support something that could be termed lossless cropping as long as you cut on the data boundaries (packet in mp3, 8x8 block on jpeg) where the data you crop out obviously gets thrown out, but the remaining data does not get refiltered with its resulting additional informational loss.

Jeff

Yes, that's it. When people talk about lossless jpeg modifications, in 99% they are referring to "elimination of cumulative losses introduced by repeated compression and decompression". (And the other 1% ... there is a kind of JPG-based format that is lossless, but there is almost not support for it in common applications and it has poor compression ratio and hence negates the advantage of classic JPG).

Gary Collins
2009-02-03 14:25:53 UTC (about 15 years ago)

lossless cropping?

Hi,
 
There is a very nice *free* picture viewer cum editor called irfanview, which will do lossless cropping and rotation of jpeg images (not sure about the resizing, though).  
I think it's at www.irfanview.com, but if this isn't right you can find it very easily by googling "irfanview" and follow the link to official homepage.  
You would need to download irfanview  and plugins separately and install both, irfanview first. Not sure if there are versions for OS other than windows, though - you'd have to check this...  
Hope it helps,
/Gary

 

Message: 4
Date: Sun, 01 Feb 2009 19:46:10 +0800 From: zhangweiwu@realss.com
Subject: [Gimp-user] lossless cropping? To: gimp-user
Message-ID:
Content-Type: text/plain; charset=UTF-8

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping? If not, what software (better has an GUI because I am not commandline guru) on Linux can be used to do lossless cropping?

Thanks.

Claus Cyrny
2009-02-03 15:34:49 UTC (about 15 years ago)

lossless cropping?

Gary Collins wrote:

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping? If not, what software (better has an GUI because I am not commandline guru) on Linux can be used to do lossless cropping?

For Linux, there's of course the command line based ImageMagick (http://www.imagemagick.org/). You can do really amazing stuff with it (see at http://www.imagemagick.org/Usage/).

Greetings,

Claus

David Hodson
2009-02-04 09:29:38 UTC (about 15 years ago)

lossless cropping?

On Tue, 2009-02-03 at 15:34 +0100, Claus Cyrny wrote:

Gary Collins wrote:

Hello. I read from an article which says jpeg images can be cropped losslessly. I searched "lossless gimp crop" on google without good findings. Can gimp do lossless cropping? If not, what software (better has an GUI because I am not commandline guru) on Linux can be used to do lossless cropping?

For Linux, there's of course the command line based ImageMagick (http://www.imagemagick.org/). You can do really amazing stuff with it (see at http://www.imagemagick.org/Usage/).

But it doesn't do lossless jpeg processing!

-- David

Johan Vromans
2009-02-04 22:09:35 UTC (about 15 years ago)

lossless cropping?

David Hodson writes:

For Linux, there's of course the command line based ImageMagick (http://www.imagemagick.org/). You can do really amazing stuff with it (see at http://www.imagemagick.org/Usage/).

But it doesn't do lossless jpeg processing!

No, it is just like the GIMP: it reads (hence decompresses) the image and recompresses it when saving.

For lossless manipulation, use jpegtran and jhead. Of course, cropping, flipping and rotating by right angles only.

-- Johan

zhangweiwu@realss.com
2009-03-23 09:28:01 UTC (about 15 years ago)

lossless cropping?

Johan Vromans schrieb:

it is just like the GIMP: it reads (hence decompresses) the image and recompresses it when saving.

For lossless manipulation, use jpegtran and jhead. Of course, cropping, flipping and rotating by right angles only.

And mapivi does it with GUI on Linux. http://mapivi.sourceforge.net/mapivi.shtml

2014-08-18 16:57:17 UTC (over 9 years ago)
postings
1

lossless cropping?

Vlasta wrote on 2009-02-02 10:53:04 UTC:

while I have heard about possible plans about how to do lossless resizing from one of the JPEG guys, it would require extension of the standard and it would only be able to resize to 1/8, 2/8, 3/8, ... of the original size.

It does not really make much sense, resizing is destructive by nature and you usually resize picture to make the file physically smaller, which would not be possible if it were lossless.

BTW, I am author of a Windows application for lossless rotation cropping, canvas extension and retouching called RealWorld Photos.

Not an extension of the standard, but a different standard.

I was reading jpeg2000 wikipedia when I posted the question of lossless resizing JPEG. It has the following about "multiple resolution representation":

'JPEG 2000 decomposes the image into a multiple resolution representation in the course of its compression process. This representation can be put to use for other image presentation purposes beyond compression as such.'

So I think, if an image viewer can take advantage of this feature and read only some parts of a file to render a reduced-resolution picture, the higher resolution representation then can be stripped off to resize a picture without fully decompress it first.

Back at the time I post the question, I was naive and intuitively think jpeg200 is just a flavour of JPEG, and must be a commonly used flavour, like HTML4 is a flavour of HTML and most commonly used one. Now I know they are incompatible standards. Since jpeg2000 failed to get much practical use, whether or not it can resize losslessly became a moot point.