Inserting small graphic makes file very large

Everything related to our flagship word processor.
Post Reply
User avatar
greenmorpher
Posts: 767
Joined: 2007-04-12 04:01:46
Location: Melbourne, Australia
Contact:

Inserting small graphic makes file very large

Post by greenmorpher »

Hello orl

I have a 4,500 word Nisus Writer document with nice heads and stuff which saves as a 92 KB item.

I have a single graphic -- a gif which is 12 KB on the disk.

When I insert this 12 KB item into the 92 KB document, I get a 2.4 MB document !!!!! Say, what? The (miniature) pet elephant in the backyard weighs in lower than that!

Okay, so then I tried saving off the gif graphic as a .png. File size went up to 32 KB, but when I inserted that into NW, I got a 152 KB document. Now that's much better.

But what's going on with the gif?

Cheers, Geoff

Geoffrey Heard, Business Writer & Publisher

"Type & Layout: Are you communicating or just making pretty shapes" -- the secrets of how type can help you to sell or influence, now at the new low price of $29.95. See the book at http://www.worsleypress.com or Amazon.
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Inserting small graphic makes file very large

Post by martin »

Those are indeed some strange results- I can't readily explain why a 12K GIF makes a larger RTF file than the 32K PNG. Could you send us a (zipped) version of your 2.4MB RTF file for us to look at?
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Inserting small graphic makes file very large

Post by martin »

Thanks for sending along your file Geoff. It turns out the problem is that RTF doesn't natively support embedded GIF images in the way it does PNG images. So NWP was converting the GIF to a TIFF, whose size was almost 400K. That was then increased further due to RTF's inefficient image encoding method. In any case, I think we can do better here and save the original GIF data without converting it to a TIFF.
User avatar
greenmorpher
Posts: 767
Joined: 2007-04-12 04:01:46
Location: Melbourne, Australia
Contact:

Re: Inserting small graphic makes file very large

Post by greenmorpher »

Excellent, Mark, since GIF format is a very efficient way of saving images with a low number of colours.

Cheers, Geoff

Geoffrey Heard, Business Writer & Publisher

"Type & Layout: Are you communicating or just making pretty shapes" -- the secrets of how type can help you to sell or influence, now at the new low price of $29.95. See the book at http://www.worsleypress.com or Amazon.
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Inserting small graphic makes file very large

Post by martin »

I'm Martin, not Mark, but you're welcome all the same :)

Even if we do fix this, it would still be most efficient in terms of file size if you used the PNG format for your inserted images. That is because even if NWP stores the original GIF data instead of a TIFF, we would still emit an alternative version of your GIF so other RTF readers could pick up the image. Essentially the file would contain both a GIF and PNG version of your image.

Besides PNG, RTF also natively supports JPEG and PICT images, so either of those would also not require redundant image data.
ptram
Posts: 280
Joined: 2007-10-21 14:59:09

Re: Inserting small graphic makes file very large

Post by ptram »

Martin,

Any chance any embedded TIFF will be compressed in LZH? Photoshop does the trick, but I cannot say how they manage to make these pics still visible in the Finder and other applicatons.

Paolo
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Inserting small graphic makes file very large

Post by martin »

Yes, I think TIFF does allow for some kind of internal lossless compression like LZH. I'm not sure if NWP makes use of it or not, but it may be worth looking into.
Post Reply