clipboardData & PNG & JPG
Scott Rossi
scott at tactilemedia.com
Wed Jul 2 15:43:00 EDT 2003
Recently, "Klaus Major" wrote:
>> I am using the following to place a JPG onto the clipboard:
>>
>> set the clipboardData["image"] to url ("binfile:"&tPhotoChoice)
>>
>> When I paste the clipboard into another app it appears to paste
>> a PNG file which is much larger in k than the original JPG.
>>
>> Is there any way to place the original JPG (and not a larger PNG)
>> onto the clipboard?
>
> i am not a techie so my explanation my be a bit naive :-)
>
> I think that JPG is a compressed fileformat (sic!) which means that the
> original image data (24 bit per pixel, no alpha channel in JPGs) will
> get decompressed when put into the clipboard or opened in memory
> by image editors.
It's true that JPEGs are compressed, but it's also true that the file format
is "lossy" (not lossless). In other words, each time a JPEG is compressed,
information is lost. With low compression, you may not notice any
artifacts, but with high compression you will see a high degree of odd color
patches and other artifacts. So in reality, the 24 bit data is not stored
in the JPEG image.
24 bit PNG is a compressed and lossless format, and GIF can also be lossless
if the source image contains no more than 256 colors.
Regards,
Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com
More information about the use-livecode
mailing list