I want to create a gif image from scratch using hex codes. I do not want to use LZW compression on the image data I produce. Is it possible to create a gif without LZW compression on image data so that all image viewing softwares can read it?
No. There is no uncompressed option in the GIF format. The image data is always compressed with LZW.
Related
Is there any way to save multipage tiff with JPEG compression in C#? It seems EncoderValue enum does not have such a value. any free .net library available to achieve this?
Purpose is to reduce file size of color multipage tiff. Tried with LZW , but still size is not reduced much.all other compression types in enum make images b&w as well.
I want to write a script to extract the PixelDATA of a DICOM file using c or c ++, I don't want to use external libraries like dicomsdl... if anyone can help me to write algorithm for extract and show image .
Just extracting the image data under the pixel data is not enough to interpret the DICOM image properly. You will need other attributes from DICOM file such as Rows, Columns, Bit Allocated, Bit Stored, High Bit, Photometric Interpretation, Sample Per Pixel to Number of Frames information just to interpret the raw uncompressed image data. Also, stored image data can be in Little Endian or Big Endian byte order. In addition, image data can be encapsulated or compressed (e.g. compressed using different compression algorithms such as JPEG, JPEG 2000, JPEG LS, RLE etc)) and compressed streams are stored differently than the uncompressed image data. Even the PixelData element can exist in multiple locations in a single DICOM file (e.g. one under the Icon Image Sequence (thumbnail) and one at the top level (actual image).
It can get more complicated when you need to account for Palette Color (segmented vs un-segmented), modality LUT, VOI LUT etc. My recommendation is to use an existing DICOM SDK and there are many open source and commercial SDK available for different platforms and programming environments.
Is there any difference between data compression and image compression when compressing JPEG images?
(to 'standardize' your question: I assume with "data compression" you mean general data file compression - in likes of .zip and .rar)
There is a "big" difference:
Data compression is "Lossless" compression - wherein you cannot afford loosing/mistaking even a single bit. Whereas..
Image compression is a "Lossy" compression - wherein you can afford to loose/mistake a certain amount of detail depending on you requirement of data-size over quality(data-reproduction). i.e. Your compressed version will not be the exact copy of your original image file; but in data compression - the compressed version will recreate the input file - exactly.
JPEG transforms RGB color space to YCbCr color space. Most of the image data is in Y channel and to avoid loss of information, it can be less compressed. But the Cb and Cr channels have color information and is mostly repetitive. This can be easily compressed.
http://nboddula.blogspot.com/2013/05/image-compression-how-jpeg-works.html
I'm trying to extract all images out of PDF files in C++. I'm stuck in decoding CCITT encoded images.
Does anyone know an opensourced code for this?
I use the ImageMagick Magick++ Library, is it possible to do the decoding with this library, too?
Thanks for your help!
CCITT is one of the encodings TIFF supports, though in a PDF file the CCITT images are probably raw data.
You can convert a raw CCITT image into a Tiff image using Fax2Tiff. It should be easy enough to work with the image once it is encoded as a Tiff.
Fax2Tiff is part of LibTiff. See LibTiff Source
Or you can append a header on it and treat it as a tiff file.
I am writing application using c++, in windows.
I want to get a thumbnail from jpeg, without decoding the whole image.
How Can I read thumbnail from jpeg exif header?
Can any one offer me a some sample code?
Many thanks!
Unsurprisingly the library is called libexif has win32 port, and there is sample code for reading thubnail from file
Don't bother. You can create tumbnails very fast from JPEGs. They are compressed using DCTs on 8x8 pixel blocks. So, get the DC component (i.e. 0,0) of each block and you have an 1/64th thumbnail without decoding. Further scaling should be fast since there are hardly any pixels left.