|
-
May 1st, 2001, 06:10 AM
#1
Thread Starter
Addicted Member
Image Compressing
I'm working on a project which requires me store images from image control / picture box as a physical file. I've tried using SavePicture Command, but it stores only in BMP format which takes up a lot of space.
I would like to store it in a compressed format, so that the image occupies minimal amount of space say below 1KB.
Anybody who can help me out regarding this
-
May 1st, 2001, 07:05 AM
#2
transcendental analytic
what format would you like to compress it in, i happen to have source for jpeg compression
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2001, 08:06 AM
#3
Thread Starter
Addicted Member
Any type of format is OK for me even JPG as long as it offers the level of compression I need, ie., some where below 1KB
-
May 1st, 2001, 08:18 AM
#4
transcendental analytic
depends, compression level is defined as a ratio of the outcome data by the original. JPEG reduces the quality until a specified ratio is obtained
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2001, 08:40 AM
#5
Thread Starter
Addicted Member
can u send me the jpeg source u have
-
May 1st, 2001, 08:44 AM
#6
transcendental analytic
yeah i could if you give me your email ad
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2001, 09:33 AM
#7
Thread Starter
Addicted Member
-
May 1st, 2001, 10:19 AM
#8
transcendental analytic
----- The following addresses had permanent fatal errors -----
<mailto:[email protected]>
(reason: 550 Invalid recipient: <"mailto:pavan_crm"@excite.com>)
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2001, 11:18 PM
#9
Thread Starter
Addicted Member
I could not get ur mail. Pls. mail me again
My email ID : Pavan ([email protected])
Last edited by pavan; May 1st, 2001 at 11:25 PM.
Pavan Kumar
-
May 2nd, 2001, 12:45 AM
#10
Addicted Member
Over here too please:P
Lo Kedaman
can you also send me the source please
[email protected]
thank you
-
May 2nd, 2001, 06:21 AM
#11
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 2nd, 2001, 08:08 AM
#12
Thread Starter
Addicted Member
sorry but I didnt catch ur meanining in N/P
-
May 2nd, 2001, 08:14 AM
#13
transcendental analytic
no problem.
btw, i'm had problem sending the mail, but now it succeeded, did you recieve it?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 2nd, 2001, 08:46 AM
#14
Thread Starter
Addicted Member
Thanx for ur reply. I think i got ur mail but i'm unable to view my inbox due to bad NET connection I'll try it again and let u know of it
-
May 3rd, 2001, 01:45 AM
#15
Thread Starter
Addicted Member
Thanx
Thanks Kedaman. I've got ur mail and have downloded it. I'm right now goin thru it and I find it very usefule.
Thanks again.
-
May 7th, 2001, 03:25 AM
#16
Thread Starter
Addicted Member
Query
Hi kedaman
I've gone thru ur code. Its compression capability is good. But I want to know how to restore the original image, after compressing it, with the same quality.
Thanx in Advance.
-
May 7th, 2001, 03:43 AM
#17
Fanatic Member
You can't, you need to use other graphics formats...
I've created my own with a little compression, you can find it here: http://psprogramming.virtualave.net/...7/dd/zlib.html
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 7th, 2001, 07:37 AM
#18
Member
Me too!
Hi kedaman,
Could you send me the code too.
[email protected]
Thanks in advance.
Sean.
-
May 7th, 2001, 08:20 AM
#19
transcendental analytic
Fleming: Sure.
pavan: A quality reducing format like jpeg looses quality every time you compress it, there's no way to restore it. Gif compression doesn't reduce the size as much as jpeg but keeps the quality, although with a max 256 color palette.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 9th, 2001, 05:19 AM
#20
Hey Kedaman, can you send it to me (sorry I'm late) please?
[email protected]
BTW, the comma or fullstop in your signiture, is that your site? And howcome I'm not welcome? No, what I mean to have said is who is welcome?
-
May 11th, 2001, 01:27 PM
#21
transcendental analytic
ok sent, yeah it's my homepage, and youre welcome to the site, if you check it out
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 12th, 2001, 12:23 AM
#22
Thread Starter
Addicted Member
hi
Hi psychomark,
I've seen ur page and also downloaded the dlls. but the problem is they work only with BMPs whereas i need the compression utility for JPGs or GIFs which originally occupy a very little space.
-
May 13th, 2001, 12:06 PM
#23
Member
Hi kedaman,
If you have already sent me the file, or even if you haven't, could you please resend it to:
[email protected]
another.com is way too slow, it takes ages for anything to get through.
Fleming.
-
May 13th, 2001, 12:14 PM
#24
Frenzied Member
PNG format is compressed, and it isn't lossy. Maybe you could find some source for that somewhere.
Harry.
"From one thing, know ten thousand things."
-
May 13th, 2001, 02:21 PM
#25
Fanatic Member
The reason I used BMP's for the compression, is that I can draw them using the raw byte data, whereas JPG's and GIF's would require you to unpack the file to disk first, then load it (using for example LoadPicture). If you don't mind temporary files, you can just compress and uncompress the pictures using the zLib.dll...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 14th, 2001, 12:47 AM
#26
Thread Starter
Addicted Member
Thanx
Thanx Psychomark for giving me the advice I will try ur advice.
-
May 14th, 2001, 11:26 PM
#27
Thread Starter
Addicted Member
Hi
Hi PsychoMark,
I've tried compressing and decompressing of JPGs with zlib.dll as u suggested.
But while compressing the compresion ratio seems to be very little / negligble for JPGs. the compressed file was only a few bytes smaller than the original file.
And while decompressing it, I repeatedly got an error saying 'out of stack space'.
can u help me out of it.
Thanx in Advance
-
May 15th, 2001, 02:17 AM
#28
Fanatic Member
1. The low compression ratios are not that strange, since JPG's are already compressed. For example, use WinZip to compress a Bitmap and a JPG in the same way, you'll notice that the JPG isn't compressed as much as the BMP.
2. Can't do anything without code, so if you still want to compress JPGs, send the code which you used to compress it, and mark the line where the error occurs...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 15th, 2001, 06:11 AM
#29
Thread Starter
Addicted Member
Reply
Hi Psychomark,
I haven't changed much the code i've downloaded. I'm getting any error at clsBitmap.cls file. Anyway I'm sending it to u as attached Zipped file
Last edited by pavan; May 21st, 2001 at 04:59 AM.
Pavan Kumar
-
May 15th, 2001, 06:20 AM
#30
Fanatic Member
Code:
' Create a bitmap out of the Byte array
cBitmap.ReadFromByteArray bData()
This is not possible, since we're reading JPG's. Comment the line out, and do the same for these:
Code:
cBitmap.ResizePicturebox picImage
cBitmap.BlitToDC picImage.hDC
picImage.Refresh
Haven't tested it, but it should work. The errors are occuring because you're trying to read the bitmap format from a JPG, which could cause VB to crash...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 22nd, 2001, 12:23 AM
#31
Thread Starter
Addicted Member
Hi,
I've tried all the advices given to me but the compressed file size seems to be a min. of 1.3KB max. its not going down further. i require the compressed image to be less than 1 KB. I've also tried reading the image pixel by pixel and storing it in the file with all the common colors codified ( an idea from vbsquare.com) but even then it has come to 1.2KB. so if anybody out ther can tell me how to achieve this i'll be thankful
Thnx in advance
-
May 22nd, 2001, 01:15 AM
#32
Fanatic Member
Can you give me the image you want to compress? If so, I can check some other possibilities...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 22nd, 2001, 03:09 AM
#33
Thread Starter
Addicted Member
hi
Hi PsychoMark
The image i want to compress is not specific. It ithe photograph of a person. U can take any photograph of a person and then try out the possibilities.
-
May 22nd, 2001, 03:15 AM
#34
Fanatic Member
Ic, well, let me know the average dimensions then, since the file size can vary a lot depending on the dimensions...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 23rd, 2001, 05:57 AM
#35
Thread Starter
Addicted Member
Dimensions
Hi
I've a requirement of Image dimensions are as follows.
The dimensions for one image are 19.05 x 25.4 mm / 0.75 x 1.0 inch
the dimensions for the other are 25.4 x 6.35 mm / 1.0 x 0.25 inch
all the dimensions are Width x Height
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|