|
Even at "100%" JPEG isn't lossless. The number isn't really a percent but a "quality factor."
|
|
|
|
|
Hi,
I'm quite a newbee at c++...
I'm just a student also,
Is it possible to use the dll in a vb6 project?
and how may I do this?
I'm having difficulties finding out what is required exactly for the dll and how to call it's functions...
|
|
|
|
|
I didnot use vb. However, if it is dll, it would be easily used by other language such as vb. Good luck!
|
|
|
|
|
你的那个导出的ImageTranscode函数不是__stdcall调用方式,VB中是用不了的;;);P
|
|
|
|
|
对了,能不能做成dll vb.net能调用的呀,最好加上tif格式,而且能不打开文件就能读出文件头的信息,比如宽高,分辨率等。。谢谢。。。
|
|
|
|
|
林,你好。我刚开始接触图象压缩格式方面,所以想问一下:jpeg2000格式的图象是否在一般的浏览器上无法显示?它和JPEG相比,其算法的优点关键 何在?谢谢
|
|
|
|
|
Usually it can not be displayed on browsers. However, you could install some ie plug-ins. Jpeg 2000 has two advantages:
1. Higher compression ration, especially in low bit rate.
2. More functionalities, such as region of interests.
|
|
|
|
|
Hi Tony, I'm a programmer, but new to image manipulation in the way you have used it. I'm currently looking into using the JPEG-2000 format for viewing very large images (for diagnosic imaging, e.g. in radiology).
My question is - when opening the jp2 files, is there any way to slow the program down to show the image loading, or is the image simply converted to a bitmap and then displayed?
If this is not possible, would you recommend any code resources from which I could attempt this myself(as I need to build some kind of view that can show the image loading while reading in the image stream)?
Apologies if this seems like a dumb question! Nice job on the program
Many thanks,
Andrew
|
|
|
|
|
Hi, dont know what your question is. Sorry. Maybe you want to see how the jpeg 2000 codec works. You had better read the Jasper codes, though it is hard to understand.
|
|
|
|
|
I got 'j2kdemo' program and had it run immediately. But seems I can not get the correct result from loading a BMP file and saving as a JPG file. The image is broken anyway no matter I use 'IJG Lib' or 'CTonyJpeg Lib' as the setting in option.
Do you have idea what's happen?
Tlin
|
|
|
|
|
Hi, maybe you need check the bmp type carefully. As you know, bmp has more than formats, even including some compression format. Good luck!
|
|
|
|
|
Hi
I have a DIB to compress and send over intranet, get it from the other side and get the dib again.
How to accomplish this ?
Thanks
|
|
|
|
|
I did some project on what you want. One easy way is to try my jpp format, which can be made in small memory and avoid disk files. You just compress a dib into a jpp memory, then transmit, then decompress.
If you try jpeg 2000, you should avoid disk operations. However, the wavelet transform in jpeg2000 is much slower than dct in jpeg.
|
|
|
|
|
In your JpegDecoder, you output the GBR value,
what if I want to get the YCbCr value instead?
|
|
|
|
|
Hah, you just skip the last step that do color conversion from YCbCr to GBR, then you get what you want.
However, you must notice the different sampling rate for Y, and CbCr.
|
|
|
|
|
CMiniJpegEncoder::CompressImage (MiniJpegEnc.cpp):
line 448: pTileRow = pInBuf + (yPixel-1) * nRowBytes + xPixel * 3;
Values of yPixel and xPixel initiated with zeroes at the start of a loop, so pTileRow points BEFORE actual data address (pTileRow = pInBuf - nRowBytes). That causes an access violation or compression of irrelevant memory content.
gnk
"In C we had to code our own bugs. In C++ we can inherit them."
|
|
|
|
|
Thanks. I should do like this:
pTileRow = pInBuf + yPixel*nRowBytes + xPixel*3;
for( y = 0; y < 16; y ++ )
{
//do something here
......
//Get data of next row
pTileRow += nRowBytes;
}
|
|
|
|
|
Thanks for fast reply, Tony!
Your implementation is really great!
gnk
|
|
|
|
|
Could use a few lines of explanation as to what you
stripped out of the .jpg header and why. Could mention a few
words on what you kept in the .jpp header as well.
For example, DICOM format is bad enough with documentation.
It is sometimes difficult and time-consuming to analyze a header from the source code alone.
|
|
|
|
|
Thanks.
JPP file heads is only 6 bytes, including image width and height, and quality factor.
No items in .jpg heads are stripped out. There are four situations when you could choose (baseline or progressive) + (Huffman or Arithmetic). There are Differences in the file header for the four situations. Usally quant table and huff table are in the file header. Other items are of little use.
For example, one common jpeg file header is 623 bytes long, like this:
app0 marker: 16 bytes.
dqt: 67 bytes, quant table, for luminance.
dqt: 67 bytes, for Cb/Cr.
sof: 17 bytes, including data_precision, height, width, component num, and hor/ver sampling factor.
dht: 31 bytes, huffman table for Y/dc coefficients.
dht: 181 bytes, huff table for Y/ac coefficients.
dht: 31 bytes, huff table for CbCr/dc.
dht: 181 bytes, huff table for CbCr/ac.
sos: start of scan, including parameters for components and scanning. After this will be data.
|
|
|
|
|
Nice work.
Thanks for this.
|
|
|
|
|
interesting job
just a minor issue for newbyes: add "..\JpegLib" in the Project settings/C C++/Preprocessor/additional include directories
and a question: both CMiniJpeg and CTonyJpeg needs JpegLib. Looking in the source code, your JpegLib seems derived from the original IJG. You added some new code, but why did you removed some features? In the end jpeglib has 24000 lines of code, where is the real difference?
Note, it' just the first impression, I'll read deeply the code in the next weeks.
|
|
|
|
|
Thanks. This work is due to the original IJG code being hard to read. I want a JPEG codec which could be easily understood. But I could not find one. So I made it possible.
The results are MiniJpeg and TonyJpeg, and they dont need the IJG codes. If you read deeply, you should see that the jpeglib is from IJG, including 47 c files, not mine. However, there are only 1379 lines for CTonyJpegEncoder, and 1560 lines for CTonyJpegDecoder, including comments and blank lines. That is all for a jpeg codec. Only two cpp files and two headfiles.
That is the difference.;);)
|
|
|
|