473,785 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the most compact way to save Image in SQL server

Al
Hi
I need to save lots of images on potentially very large database. Therefore the storage space is very crucial. I need what is most compact way to save an image. Currently I am using something like thi
Thanks in advanc
A

dim IoImageValue() As Byt
….get the bytes from InkPictureBox control
myDataRow("Grap h") = IoImageValu
Nov 20 '05 #1
4 1650
Cor
Hi Al,

There is no compact way, as far as I know is every image format (excluding
Tiff) already compacted.

Every time you delete something you delete also something from the image.

If that is not important you can look at the thumbnail method, very easy to
use if you already know how to make a bytarea from an image as I see.

I hope this helps,

Cor
I need to save lots of images on potentially very large database. Therefore the storage space is very crucial. I need what is most compact way
to save an image. Currently I am using something like this Thanks in advance
Al

dim IoImageValue() As Byte
..get the bytes from InkPictureBox control
myDataRow("Grap h") = IoImageValue

Nov 20 '05 #2
uhhh Cor... not quite :-)

Both lossless and lossy compression algorithms exist. And it seems that the
OP will consider lossy compression in order to save space.

With lossy compression it becomes a matter of how much detail is required to
convey the information you are trying to convey. And just as an example...
you can create a 2.3 MB bitmap and simply store it in a .ZIP file obtaining
99% compression and a file that is 3K in size. In this case it is a single
color bitmap. The compression (in the case of .zip "lossless compression")
depends upon the image.

Tom

"Cor" <no*@non.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi Al,

There is no compact way, as far as I know is every image format (excluding
Tiff) already compacted.

Every time you delete something you delete also something from the image.

If that is not important you can look at the thumbnail method, very easy to use if you already know how to make a bytarea from an image as I see.

I hope this helps,

Cor
I need to save lots of images on potentially very large database. Therefore the storage space is very crucial. I need what is most compact

way to save an image. Currently I am using something like this
Thanks in advance
Al

dim IoImageValue() As Byte
..get the bytes from InkPictureBox control
myDataRow("Grap h") = IoImageValue

Nov 20 '05 #3
Al
So Tom, How would you implement either of these algorithms in vb.net and ado.net
thank
Al
Nov 20 '05 #4
Hi Al,

Compression is a trade-off of time for space. Lossy compression
additionally trades off information for even more space. The trouble with
lossless compression is that it typically won't do well on binary data such
as images, audio and the like.. The reason I got such great compression on
the example I gave is only because I made the image a single color.
Obviously most images won't be a single color and a photograph will compress
a few percent at most (depending upon the format.)

The way you get the greatest compression is by storing the image in a lossy
format (as opposed to a lossless format.) Compression in JPEG images for
instance can be controlled and you can decide how much detail to lose. As
you lose detail you gain additional compression.

You have to base your decision on what the images consist of (line drawings
or photographs) and what the purpose they are ultimately intended for. If
they are going to be displayed on a web page there is both a limit to how
long somebody will wait for the image and a resolution beyond which the
viewer doesn't care. So basically experiment a little bit and decide what
is an acceptable loss of quality.

It is pointless BTW to apply .ZIP compression to a JPEG image and it
actually should grow bigger as a result. Remember that JPEG "is" a
compression algorithm, if it was possible to compress the image even more
then JPEG would simply do it. Once the data is "random" further compression
becomes impossible.

Tom

"Al" <an*******@disc ussions.microso ft.com> wrote...
So Tom, How would you implement either of these algorithms in vb.net and ado.net? thanks
Al

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1887
by: lc | last post by:
Hi, Is there a way to save the client side opened asp page as a image file to the server side. That is take a screen shoot of the page and save it as a file preferrable html file or some image file and save it onto the server. Thanks.
3
5572
by: Paolo | last post by:
Hi, I am trying to compact and repair my database, however every time I try it comes up a message saying: Table: "TempMSysAccessObject already exists", whenever I try to look for this table I cannot find it anywhere... Any clues... Already went into the help file and nothing... Also try to copy my database and the same message comes up
4
2852
by: David W. Simmonds | last post by:
Is there a way I can have a button on a ASP.NET form that when clicked will allow the user to save the image to a file on the client side? I know that the user can simply rclick the image and select Save Target as..., but the button might be a more intuitive way.
9
2158
by: DapDap | last post by:
I have manage to open a image into a picture box. But I have problem in Saving it into database SQL Server. How to save the image ??
4
2963
by: jmhmaine | last post by:
The following code works when Option Strict is off: Dim thumbSize As New Size thumbSize = CType(NewthumbSize(g.Width, g.Height, 100), System.Drawing.Size) Dim imgThumbOutput As New Bitmap(g, thumbSize.Width, thumbSize.Height) imgThumbOutput.Save(Server.MapPath(ThumbnailPath), thisFormat) When I turn on Option Strict, I receive the following compile error: Overload resolution failed because no accessible 'Save' can be called with these...
1
6496
by: WB | last post by:
Hi, I have a helper class that has a method to resize images. It takes the virtual path of an image and resize it to a specified dimension like this. public void ResizeImageTest(string pathImage, int newDimension) { string pathImageOnDisk = System.Web.HttpContext.Current.Server.MapPath(pathImage); System.IO.FileStream fs = new System.IO.FileStream(pathImageOnDisk,
2
2652
by: Ada | last post by:
First of all, I thought this might be a directory security issue but it's not. I was able to upload the file to the directory via HTTP. Here's the situation. I have a JPG file on my server. ..../images/myPIC.jpg I wanted to draw a box or line using GDI+ on top of myPIC.jpg and then save the new image to the server.
3
2207
by: Bizmark | last post by:
Access2003, Windows XP Pro OEM user OS, Windows Sever 2000 server OS. Not-so-recently I inherited 3 Access DB's from another company merging with our own. Our own system works off of SQL server, but mainting these databases is critical to keeping the business running. 1 database in particular has been causing problems. Along the course we have had a few problems with random records corrupting (new and old) and Values within fields...
3
3106
by: neovantage | last post by:
Hey all, i have created image by mixing logo and the original image. It create image and show in the same window. I have done 3 steps for this. First i upload an image to my server by using move_upload_file, then i resize it using class "thumbnail.class.php" My next step was to embed company logo in it(which i already done) and save new embedded logo image to the path where i first upload the original image i mean i want to overwrite...
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9954
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.