There are many common file formats, for example jpeg images.
Suppose a jpeg image exists on two systems, one using big endian and the other small endian.
Will the saveed jpeg files look different?
In other words, if we have the images saved in a contiguous area of memory say starting from byte 0, will the images be the same?
Related
I was wondering if any lossless image compression format such as PNG comes with some kind of uniqueness guarantee, i.e. that two different compressed binaries always decode to different images.
I want to compute the hash of images that are stored in a lossless compression format and am wondering if computing the hash of the compressed version would be sufficient.
(There are some good reasons to compute the hash on the uncompressed image but there are out of the scope of my question here.)
No, that's not true for PNG. The compression procedure have many parameters (filtering type used for each row, ZLIB compression level and settings), so a single raw image can result in many different PNG files. Even worse, PNG allows to include ancillary data (chunks) with miscelaneous info (for example, textual comments).
Archives of JPEG files don't compress well, ostensibly because each JPEG is already highly compressed. However, when there is much redundancy between images (e.g., archived stills from a stationary camera), and the number of files is large (think thousands or more), there comes a point when failure to exploit the redundancies makes JPEG seem dramatically inefficient for files to be stored in archives.
What approach and archive format would give the best compression of JPEG files?
We have a project which will generate lots (hundreds of thousands) of .PNG images that are around 1mb. Rapid serving is not a priority as we use the images internally, not front end.
We know to use filesystem not DB to store.
We'd like to know how best to compress these images on the server to minimise long term storage costs.
linux server
They already are compressed, so you would need to recode the images into another lossless format, while preserving all of the information present in the PNG files. I don't know of a format that will do that, but you can roll your own by recoding the image data using a better lossless compressor (you can see benchmarks here), and have a separate metadata file that retains the other information from the original .png files, so that you can reconstruct the original.
The best you could get losslessly, based on the benchmarks, would be about 2/3 of their current size. You would need to test the compressors on your actual data. Your mileage may vary.
I have applied JPEG baseline compression algorithm by writing each step in matlab. Now, I have the JPEG compresses image data in binary form and the header to be appended. Please tell me how to make a file that would be recognized as JPEG file by OS. Should it be binary file or what is the process.?
Regards
You are going to need to read two thing:
1) The JPEG standard
2) The standard for some file format (e.g., JFIF, EXIF).
You are going to need to have a JPEG file header (see file format standards). You are going to have to create DHT, DQT, SOF, and SOS markets for the compressed data (JPEG standard).
All of the data is in binary format. You have to remember to convert FF values in the compressed data stream to FFFF.
What are similar compressors to the RAR algorithm?
I'm interested in compressing videos (for example, avi) and images (for example, jpg)
Winrar reduced an avi video (1 frame/sec) to .88% of it's original size (i.e. it was 49.8MB, and it went down to 442KB)
It finished the compression in less than 4 seconds.
So, I'm looking to a similar (open) algorithm. I don't care about decompression time.
Compressing "already compressed" formats are meaningless. Because, you can't get anything further. Even some archivers refuse to compress such files and stores as it is. If you really need to compress image and video files you need to "recompress" them. It's not meant to simply convert file format. I mean decode image or video file to some extent (not require to fully decoding), and apply your specific models instead of formats' model with a stronger entropy coder. There are several good attempts for such usages. Here is a few list:
PackJPG: Open source and fast performer JPEG recompressor.
Dell's Experimental MPEG1 and MPEG2 Compressor: Closed source and proprietry. But, you can at least test that experimental compressor strength.
Precomp: Closed source free software (but, it'll be open in near future). It recompress GIF, BZIP2, JPEG (with PackJPG) and Deflate (only generated with ZLIB library) streams.
Note that recompression is usually very time consuming process. Because, you have to ensure bit-identical restoration. Some programs even check every possible parameter to ensure stability (like Precomp). Also, their models have to be more and more complex to gain something negligible.
Compressed formats like (jpg) can't really be compressed anymore since they have reached entropy; however, uncompressed formats like bmp, wav, and avi can.
Take a look at LZMA