Re: Help with extending a still frame



On Wed, 30 Sep 2009 10:04:28 -0400, in 'rec.video.desktop',
in article <Re: Help with extending a still frame>,
"Arny Krueger" <arnyk@xxxxxxxxxx> wrote:

"Frank" <frank@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:h5u5c5l3a74dsfbbk5rrqngft92vdvjskb@xxxxxxx
On Tue, 29 Sep 2009 16:27:48 -0400, in
'rec.video.desktop',
in article <Re: Help with extending a still frame>,
"David Ruether" <d_ruether@xxxxxxxxxxxx> wrote:


"David Ruether" <d_ruether@xxxxxxxxxxxx> wrote in
message news:h9tq9o$p14$1@xxxxxxxxxxxxxxxxxxxxxxx

[That should have been...;-]
I would not generally save a photo as a GIF file since
GIFs
generally don't handle gradient tones very well. Use
TIF, PSD, BMP - or possibly JPG (if the compression
rate isn't high enough to do visible damage to the
image). I reserve GIFs
for highly compressed text, which looks better in that
than
in highly compressed JPGs.
--DR
[Been a bad week...]

GIF is an 8-bit palettized graphics format that uses
lossless LZW compression.

Magic word: lossless. That makes it especially good when you're doing chroma
key. I've been doing a lot of that lately.

GIF is lossless in the sense that LZW is a general purpose data
compression algorithm and as such is lossless (like a RAR file or a
TAR file or dare I say it, a ZIP file or a SIT file).

GIF is also lossless in the sense that you can recompress a GIF
countless times and the colors always remain the same. They don't
shift around, such as would typically occur with normal JPEG
(re-)compression.

As to chroma key, GIF doesn't support a traditional 8-bit alpha
channel, although it does support transparency in that any given
palette entry within a GIF file can be designated as "transparent".

Transparent in this case means that the 24-bit RGB color value that
has been assigned to that particular palette entry will be treated as
transparent when the image is viewed. Note that only one palette entry
(not multiple palette entries) can be defined as being transparent.

What's interesting is that it's perfectly valid for multiple palette
entries to define the same color.

What this means, and I'll use the simple case where just two palette
entries define the same color - let's say a pure red (RGB FF0000 in
hex) for the sake of discussion - is that if palette entry number 26
defines red and palette entry number 139 also defines red but
additionally designates it as being the transparent color, wherever
entry 26 appears in the image it will appear as red, but wherever
entry 139 appears in the image, it will appear as transparent -
meaning that if the entire image were overlaid over a green background
(for example), you would see red wherever palette entry number 26 was
used but you would see green (the background) wherever palette entry
number 139 appeared in the image.

This is easier to explain by actual example than in a pure text form.
:)

The size of a GIF file can often be reduced by removing duplicate
palette entries, that is, where multiple palette entries define the
same color. Of course, if two palette entries define the same color
and one of those entries is defined as transparent and you want to
maintain the transparent effect, then you're stuck with two palette
entries.

GIF (in its 89a variant) also supports animation. For such a simple
format, there's actually a lot that can be done with it, especially in
such a small number of bytes (GIF files tend to be very small in size
primarily because they're a palettized format and only secondarily
because they're always compressed, unlike say a TIFF file, which can
use a variety of compression algorithms or can be uncompressed).

Of course, we now live in a world where few people seem to concern
themselves with file sizes any longer (bandwidth is free, right?).
Most people that I run into these days arbitrarily save all images
either as JPEG or PNG without consideration for file size and, in
particular, whether a potentially much smaller-sized file could be
created by using the good old GIF format.

In fact, most of the people that I run into these days don't know what
a GIF file is. Sure, they know that it's some sort of graphics file
format, but they seem to know nothing else about it. Since their
(point-and-shoot) digital still image camera (and their cell phone)
only creates JPEG files, that's all that matters to them in the world
of graphics. They also seem to not know the difference between raster
graphics and vector graphics. They go, "Vecter what?".

When determining whether a given image can be safely saved as a GIF
without suffering color loss, it's helpful to be using an image
editing application that includes a function to count the number of
unique colors in an image. The free XnView program can do this, for
example. On a personal level, I've also got an old version of Paint
Shop Pro that can count the number of unique colors within an image.

Naturally (sarcasm intended), for certain images (not all images, just
a few) I've seen these two programs report two different values. I've
no idea which is correct, if indeed either of them is; for all that I
know, they're both wrong. The difference is small, usually 10 or 20 or
so colors, so I don't stay up nights worrying about it.

There's a sort of corollary in the audio world as well. I've seen
Adobe Audition (and the older Syntrillium Cool Edit Pro upon which
it's based) report that a particular audio file contains clipping when
Sound Forge reports that the same file has no clipped peaks. In this
case, for whatever reason, I tend to believe Sound Forge over
Audition. Again, I've never taken the time to determine which program
is right and which is wrong. It may be nothing more than a difference
in how the two applications define clipping.

Because it uses an 8-bit pallet, at best it can hold
images having no more than 256 unique colors. While this
makes it well suited for non-aliased text, logos,
drawings, and other imagery of this nature, including
1-bit black-and-white images,

That't the one!

it's not at all suited for
full color images such as those found in nature (people,
trees, etc.).

That depends.

However, because each of the 256 unique colors is chosen
from a palette of 16,777,216 colors (aka 24-bit True
Color), any source image that contains no more than 256
unique colors can be losslessly saved as a GIF file even
when that source image is a full color photograph.

Nicely said. As always, do what works. I use GIF a fair amount of time for
stills because it is lossless, because I do play with pallettes a lot, and
because I run into enough stuff that may appear to have continuous tones,
but in the end a pallette of merely 256 colors gets the job done.

Yes, being able to directly manipulate the palette is a wonderful
capability.

I do a lot of work with line and solid fill art.

Also, my usual target presentation device is a 6k lumen DLP projector
projecting on a 20' diagonal screen in a 450 seat venue with marginal
control over ambient lighting, so I can get away more than others may. ;-)

As I get older, I find myself sitting closer to the computer monitor
and to the television. At this rate, I will soon BE the television. :)

As to the original poster, while export/import of frames may not be
the best approach to use, if this technique were to be used, the best
formats to use would be BMP followed by (non-compressed) TIFF. TGA
(Targa) would also be a good choice. GIF, JPEG, and PNG should be
avoided in this application, in my opinion.

--
Frank, Independent Consultant, New York, NY
[Please remove 'nojunkmail.' from address to reply via e-mail.]
Read Frank's thoughts on HDV at http://www.humanvalues.net/hdv/
(also covers AVCHD and XDCAM EX).
.



Relevant Pages

  • Re: |AX| Re: Help with extending a still frame
    ... TIF, PSD, BMP - or possibly JPG (if the compression ... GIF is lossless in the sense that LZW is a general purpose data ... is there a video format with smaller color palette? ...
    (rec.video.desktop)
  • Re: |AX| Re: Help with extending a still frame
    ... TIF, PSD, BMP - or possibly JPG (if the compression ... GIF is also lossless in the sense that you can recompress a GIF ... Still, I wonder, is there a video format with smaller color palette? ... palette entry within a GIF file can be designated as "transparent". ...
    (rec.video.desktop)
  • Re: HTML safe colors
    ... will be mapped to the nearest supported color. ... combinations of browser/display adapter tried to display the colour by ... 256 colour palette and if there are more than one of them on a page then the ... The first gif would display correctly as each of its colours (well most of ...
    (comp.infosystems.www.authoring.html)
  • Re: Place a DIV above all site content
    ... isolate areas of similar colors to greatly reduce the palette for the part can significantly reduce the PNG or GIF size but when "reassembled" gives the appearance of a full color image. ... Now if you have a logo for example and the image has golden text and a symbol in greens and so blue thing of to the side, to convert it to pallet and not look "poster-ized" you may have to use all 8-bits 256 colors. ...
    (alt.html)
  • Bitmap palette
    ... offset buffer;set buffer to receive palette ... ;(because BIOS int10h (which sets a block of DAC color registers(function ... on top of this each palette entry has to be divided by 4(I've been using shr ...
    (comp.lang.asm.x86)