Re: OT: Eliminating all pixels around a figure

2006-06-14 Thread Stephen Harris

Paul Smith wrote:

On 6/14/06, Stephen Harris <[EMAIL PROTECTED]> wrote:

> Thanks, David and Georg. In particular, I am trying to find a tool to
> work on Linux. Gimp is a Linux application, but maybe there is already
> a Linux equivalent of StripFile:
>
> http://www.nuetools.co.uk/stripfile.html
>
> I will ask for it on the Fedora mailing list.

Stripfile succeeds mainly by removing embedded comments/text.

http://files.linuxforum.com/man/jpegtran.1.php
"jpegtran also recognizes these switches that control
what to do with "extra" markers, such as comment blocks:

-copy none
 Copy no extra markers from source file. This setting
suppresses all comments and other excess baggage present
in the source file.

-optimize
 Perform optimization of entropy encoding parameters.

  -trim  Drop non-transformable edge blocks."

http://mapivi.sourceforge.net/mapivi.shtml

http://rpmfind.net/linux/RPM/suse/9.0/i386/suse/i586/ungifsicle-1.39-34.i586.html 



http://www.intuitive.com/coolweb/FAQ/giftrans-doc.html
giftrans converts any GIF file into a GIF89a. Allows for
setting the transparent or background color, changing colors,
adding or removing comments. Also code to analyze GIF contents.

SH: These all work on Linux but only MapIvi has a nice interface.

embedded JPEG comments (single and multiple comments are supported):
 * display
 * add, edit, copy, join or remove


Thanks, David and Stephen. Meanwhile, a gentleman has suggested me
pngcrush, which I have tried with significant size reduction of png
images, with no loss of quality. Please, have a look at:

http://pmt.sourceforge.net/pngcrush/

It is command line oriented and also works on MS Windows.



There seems to be a quite recent release also.


Paul



SH: After nosing around into Netpbm, I looked at ImageMagick:

http://www.cit.gu.edu.au/~anthony/graphics/imagick6/formats/

Reading JPEG Images

+profile '*'
-strip
   "JPEG images as saved by digital cameras, scanning
software and other image processing software like "photoshop"
will often add large profiles of "program comments" to JPEG
images. Either of these options will remove those profiles
from a image that was read in.

Non-ImageMagick JPEG Processing

As re-writing a JPEG image results in a degrading of image
quality (unless lossless compression is used) the JPEG image
library provides a number of special programs that can
manipulate the image, without loss of quality.

These command will also be generally a lot faster than IM
equivalents, as they do not have to do as much processing
of the image.

Examples of these commands include...

read comments:   rdjpgcom  image.jpg
remove comments: wrjpgcom -replace -comment '' image.jpg > new_image.jpg
remove profiles: jpegtran -copy none image.jpg > new_image.jpg

-

Here is an example of a shell command to convert all your of PNG
files (named *.png) to JPEG files named *.jpg:

for i in *.png; do pngtopnm $i | ppmtojpeg >`basename $i .png`.jpg; done

jpegtran Does some of the same transformations as Netpbm is famous for, 
but does them specifically on JPEG files and does them without loss of 
information."

---

SH: One would imagine that pngcrush would be better specialized to
do conversions than using a Netpbm command or some piped commands.

Jpeg appears to have the best stripping options. I don't know if
converting other image formats to jpeg for stripping is clever.

Regards,
--
Stephen
Topic ontology recapitulates entropic philology.


Re: OT: Eliminating all pixels around a figure

2006-06-14 Thread Paul Smith

On 6/14/06, Stephen Harris <[EMAIL PROTECTED]> wrote:

> Thanks, David and Georg. In particular, I am trying to find a tool to
> work on Linux. Gimp is a Linux application, but maybe there is already
> a Linux equivalent of StripFile:
>
> http://www.nuetools.co.uk/stripfile.html
>
> I will ask for it on the Fedora mailing list.

Stripfile succeeds mainly by removing embedded comments/text.

http://files.linuxforum.com/man/jpegtran.1.php
"jpegtran also recognizes these switches that control
what to do with "extra" markers, such as comment blocks:

-copy none
 Copy no extra markers from source file. This setting
suppresses all comments and other excess baggage present
in the source file.

-optimize
 Perform optimization of entropy encoding parameters.

  -trim  Drop non-transformable edge blocks."

http://mapivi.sourceforge.net/mapivi.shtml

http://rpmfind.net/linux/RPM/suse/9.0/i386/suse/i586/ungifsicle-1.39-34.i586.html

http://www.intuitive.com/coolweb/FAQ/giftrans-doc.html
giftrans converts any GIF file into a GIF89a. Allows for
setting the transparent or background color, changing colors,
adding or removing comments. Also code to analyze GIF contents.

SH: These all work on Linux but only MapIvi has a nice interface.

embedded JPEG comments (single and multiple comments are supported):
 * display
 * add, edit, copy, join or remove


Thanks, David and Stephen. Meanwhile, a gentleman has suggested me
pngcrush, which I have tried with significant size reduction of png
images, with no loss of quality. Please, have a look at:

http://pmt.sourceforge.net/pngcrush/

It is command line oriented and also works on MS Windows.

Paul


Re: OT: Eliminating all pixels around a figure

2006-06-13 Thread Stephen Harris

Paul Smith wrote:


Thanks, David and Georg. In particular, I am trying to find a tool to
work on Linux. Gimp is a Linux application, but maybe there is already
a Linux equivalent of StripFile:

http://www.nuetools.co.uk/stripfile.html

I will ask for it on the Fedora mailing list.

Paul




Stripfile succeeds mainly by removing embedded comments/text.

http://files.linuxforum.com/man/jpegtran.1.php
"jpegtran also recognizes these switches that control
what to do with "extra" markers, such as comment blocks:

-copy none
Copy no extra markers from source file. This setting
suppresses all comments and other excess baggage present
in the source file.

-optimize
Perform optimization of entropy encoding parameters.

 -trim  Drop non-transformable edge blocks."

http://mapivi.sourceforge.net/mapivi.shtml

http://rpmfind.net/linux/RPM/suse/9.0/i386/suse/i586/ungifsicle-1.39-34.i586.html

http://www.intuitive.com/coolweb/FAQ/giftrans-doc.html
giftrans converts any GIF file into a GIF89a. Allows for
setting the transparent or background color, changing colors,
adding or removing comments. Also code to analyze GIF contents.

SH: These all work on Linux but only MapIvi has a nice interface.

embedded JPEG comments (single and multiple comments are supported):
* display
* add, edit, copy, join or remove

-

--
Stephen
Topic ontology recapitulates entropic philology.


Re: OT: Eliminating all pixels around a figure

2006-06-13 Thread David Neeley

Ah, Linux is another relatively simple problem. Here are some options:

1. Perhaps the best method for image compression today comes from a
technique and package known as SPIHT, which uses wavelet compression.
Packages are available for various operating systems, including Linux.
See http://www.siliconimaging.com/SPIHT.htm

2. Djvulibre, open source lossless compression format ideal for
replacement of pdf, tiff, gif, jpg, png, and large scanned images with
no loss of compression and the same appearance on all platforms.
Unfortunately, I do not know if it can be induced to work within
LaTeX/LyX--haven't done much research on it on the open source side.
It is a superior compression product, though, if it can be made to
work! This stems from research at AT&T Labs originally; Windows and
Mac commercial tools are now being sold by Lizardtech; the Linux
variants are GPL.

3. A 1999 Linux Journal article on image compression:
http://www.linuxjournal.com/article/2567 Contains various methods for
doing the compression and the issues surrounding them.

4. An extremely effective library for one-bit image compression
(scanned documents, for example) is jbigkit:
http://rpmfind.net/linux/rpm2html/search.php?query=jbigkit

5. You can also use ImageMagick to convert your image files in any of
several ways to get smaller file sizes. You can create the transparent
piece as you originally asked, and you can also reduce the number of
colors used -- which can have a very beneficial impact on image size.
If, for example, you have a 24-bit image, you can often reduce it to
15 or 16 bit color with little if any apparent loss of quality yet
with far less size.

That at least may get you going.

David

On 6/13/06, Paul Smith <[EMAIL PROTECTED]> wrote:

On 6/13/06, David Neeley <[EMAIL PROTECTED]> wrote:
> Transparent layers are only supported on a few file formats, of course.
>
> That said, there are a number of programs available that allow you to
> optimize your images, often *greatly* reducing file size.
>
> For example, if you use Windows you might look at the freeware
> selections at http://www.snapfiles.com. They have a category called
> "Image Compression" under Graphic Tools--and you can choose from a
> variety of programs depending upon your needs. The same site also has
> some graphic editors that allow for image compression as a built-in
> function.
>
> Similar tools exist for other operating systems as well.

Thanks, David and Georg. In particular, I am trying to find a tool to
work on Linux. Gimp is a Linux application, but maybe there is already
a Linux equivalent of StripFile:

http://www.nuetools.co.uk/stripfile.html

I will ask for it on the Fedora mailing list.

Paul



Re: OT: Eliminating all pixels around a figure

2006-06-13 Thread Paul Smith

On 6/13/06, David Neeley <[EMAIL PROTECTED]> wrote:

Transparent layers are only supported on a few file formats, of course.

That said, there are a number of programs available that allow you to
optimize your images, often *greatly* reducing file size.

For example, if you use Windows you might look at the freeware
selections at http://www.snapfiles.com. They have a category called
"Image Compression" under Graphic Tools--and you can choose from a
variety of programs depending upon your needs. The same site also has
some graphic editors that allow for image compression as a built-in
function.

Similar tools exist for other operating systems as well.


Thanks, David and Georg. In particular, I am trying to find a tool to
work on Linux. Gimp is a Linux application, but maybe there is already
a Linux equivalent of StripFile:

http://www.nuetools.co.uk/stripfile.html

I will ask for it on the Fedora mailing list.

Paul


Re: OT: Eliminating all pixels around a figure

2006-06-13 Thread David Neeley

Transparent layers are only supported on a few file formats, of course.

That said, there are a number of programs available that allow you to
optimize your images, often *greatly* reducing file size.

For example, if you use Windows you might look at the freeware
selections at http://www.snapfiles.com. They have a category called
"Image Compression" under Graphic Tools--and you can choose from a
variety of programs depending upon your needs. The same site also has
some graphic editors that allow for image compression as a built-in
function.

Similar tools exist for other operating systems as well.

HTH

David

On 6/13/06, Georg Baum <[EMAIL PROTECTED]> wrote:

Paul Smith wrote:

> Dear All
>
> I have taken a screen-shot of a certain window containing an intricate
> figure. Around the figure everything is white. Then I thought that
> changing the white to transparent, I would get a picture with a
> smaller size, which would lead to a pdf document with a smaller size
> too. Can this be achieved? If yes, how?

I always use gimp for this: Image->Autocrop image works fine (except when
there are some nonwhite pixels left, e.g. from a scan, but then I erase
them before.


Georg




Re: OT: Eliminating all pixels around a figure

2006-06-13 Thread Georg Baum
Paul Smith wrote:

> Dear All
> 
> I have taken a screen-shot of a certain window containing an intricate
> figure. Around the figure everything is white. Then I thought that
> changing the white to transparent, I would get a picture with a
> smaller size, which would lead to a pdf document with a smaller size
> too. Can this be achieved? If yes, how?

I always use gimp for this: Image->Autocrop image works fine (except when
there are some nonwhite pixels left, e.g. from a scan, but then I erase
them before.


Georg



OT: Eliminating all pixels around a figure

2006-06-13 Thread Paul Smith

Dear All

I have taken a screen-shot of a certain window containing an intricate
figure. Around the figure everything is white. Then I thought that
changing the white to transparent, I would get a picture with a
smaller size, which would lead to a pdf document with a smaller size
too. Can this be achieved? If yes, how?

Thanks in advance,

Paul