Click here to Skip to main content
13,046,773 members (56,981 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hello friends,

i want to save images in a database and want to 1st compress it, or make it small size so that database will be of small size. How to do that? Using SQL 2005 database.
Posted 28-Jun-13 7:02am
ThePhantomUpvoter 28-Jun-13 13:05pm
Sergey Alexandrovich Kryukov 28-Jun-13 13:41pm
It may make sense, but usually image-specific compression is used (JPEG, PNG and a lot more). Please see my answer.
(OP just confirmed that this is what's needed: JPEG.)
Sergey Alexandrovich Kryukov 28-Jun-13 13:35pm
Lossless or lossy (like JPEG)? Image-specific or general purpose. Image compression comes with System.Drawing.Bitmap.
BCD23 28-Jun-13 13:39pm
JPEG images. image specific
Sergey Alexandrovich Kryukov 28-Jun-13 13:41pm
Good, you have my answer; this is all you need.
BCD23 28-Jun-13 13:48pm
Using this should i get less database size than normal? And is there another way of saving images in database by maintaining size of database? want to retrieve it also in image viewer. so no resolution compromise.
Sergey Alexandrovich Kryukov 28-Jun-13 13:57pm
I don't know what do you call "normal". Just follow my advice, experiment with compression parameters and resulting compressed data sizes. Nobody can tell you anything exactly in advance. Do you understand that real compression ratio depends on the content of the image? It will be lower with the images having more fine detail.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please see my comment to the question and this:[^],[^].

For compression specific to images and standard image compression algorithms, please see:[^],[^],[^].

In each format, find and read its specification, to learn about its compression quality, compression rate vs quality and other related properties. This topic is too big to cover in a Quick Answer, but you can easily find a reasonably good option for your purpose; just do some minimal research and experimenting.

CPallini 28-Jun-13 15:06pm
Sergey Alexandrovich Kryukov 28-Jun-13 17:11pm
Thank you, Carlo.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 28 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100