Hi,
When using the "import" command for creating a PNG or a GIF image, then selecting a part of the screen, the resulting image bounds will not correspond to the selected zone. In particular :
* import file.png : the resulting file will have correct dimensions, but the selected zone will be outside the image.
* import file.gif : the resulting file will have the same dimensions as the screen, and the selected zone will be a small part of it.
When opening the PNG image with the Gimp, it will prompt you that "the PNG file specifies an offset that caused the layer to be positioned outside the image".
In each case, the empty zone being transparent. There seems to be no issue with JPG images.
I'm currently using Fedora 10, and :
Version: ImageMagick 6.4.0 07/27/08 Q16
However, I have encountered this behaviour on Scientific Linux (4?) as well, with this version :
Version: ImageMagick 6.0.7 04/17/08 Q16
Offset issue in PNG and GIF using "import"
Re: Offset issue in PNG and GIF using "import"
Add +repage to your command line to remove the virtual page offset from your image.
Re: Offset issue in PNG and GIF using "import"
Thanks for the tip !
Hopefully this thread will be helpful for other people in the same case.
However, the +repage option should be the default, for at least two good reasons :
1/ What is the point of selecting an area if the final image doesn't fit ? This is not the expected behaviour.
2/ The behaviour is different depending on the file format, which does not make sense.
So, is there a reason for which it is an option ?
Hopefully this thread will be helpful for other people in the same case.
However, the +repage option should be the default, for at least two good reasons :
1/ What is the point of selecting an area if the final image doesn't fit ? This is not the expected behaviour.
2/ The behaviour is different depending on the file format, which does not make sense.
So, is there a reason for which it is an option ?
Re: Offset issue in PNG and GIF using "import"
BTW, the +repage option does not seem to exist for the old version (6.0.7, see first post). Is there any workaround ? (Upgrading is not an option)
Re: Offset issue in PNG and GIF using "import"
Try -page +0+0.
Re: Offset issue in PNG and GIF using "import"
Forgot to mention, actually I made an alias so that import calls mogrify :
(This is tcsh.)
NB : And I just tested your suggestion on my local version (the one where the +repage option exists), it does not seem to work. Anyway the alias works, so this is not a problem anymore (but again, +repage *should* be the default on the current release).
Code: Select all
alias import 'import \!:1; mogrify +repage \!:1'
NB : And I just tested your suggestion on my local version (the one where the +repage option exists), it does not seem to work. Anyway the alias works, so this is not a problem anymore (but again, +repage *should* be the default on the current release).