473,756 Members | 8,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing Color depth of a jpeg image

is there a way to reduce or modify the color depth of a jpeg image, i
currently need to programatically change the color depth of a jpeg image
from 24bits to 8bits. any help would be appreciated

May 26 '06 #1
2 4167
The color depth of a JPEG image is 8 bits per color channel. There is no
JPEG format (except grayscale) with a color depth of 8 bits per pixel.

Onwuka Emeka wrote:
is there a way to reduce or modify the color depth of a jpeg image, i
currently need to programatically change the color depth of a jpeg image
from 24bits to 8bits. any help would be appreciated

May 27 '06 #2
I found a solution. http://freeimage.sourceforge.net/. there is a nice
though incomplete .NET wrapper for it, it has a method that converted the
24bit to 8bit, and yeah its grayscale :).

I updated the wrapper and would be posting it to my blog soon.

Thanks.

"Göran Andersson" <gu***@guffa.co m> wrote in message
news:OT******** ******@TK2MSFTN GP05.phx.gbl...
The color depth of a JPEG image is 8 bits per color channel. There is no
JPEG format (except grayscale) with a color depth of 8 bits per pixel.

Onwuka Emeka wrote:
is there a way to reduce or modify the color depth of a jpeg image, i
currently need to programatically change the color depth of a jpeg image
from 24bits to 8bits. any help would be appreciated

May 28 '06 #3

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

Similar topics

3
2398
by: JJM | last post by:
Can anyone please help me with this I'm a total newbie and just getting started in JS. I have a page where I would like to display a picture and a short textual explanation of the picture. I have several pictures that I would like to display all linking from a previous page. At present what I'm doing is linking each thumbnail to an individual html page showing the larger image with the text. It struck me that as the rest of the page is...
1
2164
by: Sean | last post by:
i am writing a class that visual demonstrates the result of changing the quality of a jpeg. the intention is to do this by saving the file and a selected quality, then reloading it to get an idea of what the image looks like, and how big it is. the quality is selected using a trackBar1. the MouseUp event of trackBar1 triggers this method public void updatePanel() string file =...
1
3659
by: Shawn | last post by:
Hi. I haven't been able to get an answer in the vb newsgroup on the topic, so I'll try here. I'm converting .tif images into other image formats like ..jpeg and .gif and I need to know how I can control the bit depth of these images. The System.Drawing.Image object's default bit depth when saving images seems to be 24 for .jpeg and 8 for .gif. Thanks, Shawn
7
3400
by: Scott Schluer | last post by:
Is there a way to use the Image class to convert a color photo (GIF or JPEG) to a B&W photo? Thanks, Scott
1
3265
by: Onwuka Emeka | last post by:
is there a way to reduce or modify the color depth of a jpeg image, i currently need to programatically change the color depth of a jpeg image from 24bits to 8bits. any help would be appreciated
9
9641
by: kombu67 | last post by:
I'm reading a series of images from a MS SQL table and saving them to directory. These are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to disk, I need to reference the disk file in our HR app. As part of the process, I'm resizing the image and changing its resolution from 96 to 72 dpi. If they are not at a 72 dpi resolution, the HR app freezes. The resizing works without a hitch, but...
1
4473
by: markurxn | last post by:
I need a solution to automatically change the DPI of uploaded photos from 300 to 72. I've coded this bit of script to read the 14th through 18th bit of binary data of a JPEG and update the DPI. The script below seems to be writing to the jpeg, but the afterwards, the jpeg is unreadable and when I rerun the script, it still shows the image DPI hasn't changed. Anyone have experience changing DPI of an image? <?php $filename =...
5
3410
by: RobT | last post by:
I'll admit, that I don't do a lot of GDI+ programming and I'm sure this is an easy answer. I'm trying to draw a couple of shapes in a web site. I can display them just fine, but on some of the fill colors are pixelated. Is there a way to render these colors at a better color depth? Dim bmp As Bitmap bmp = New Bitmap(200, 200) Dim g As Graphics g = Graphics.FromImage(bmp) g.Clear(Color.White)
3
4511
dlite922
by: dlite922 | last post by:
Hey guys, I have limited access to a server and would be a pain to install and configure an image library such as GD or Imagick with PHP. Is there any other progmatically some-what reliable way to check the bit-depth of a png or jpg image? (e.g. 16-bit, 32-bit, 64-bit) This of course, means opening up the file and taking a peek inside, but the files look different. There's no such thing as a bad idea, just untried ones, so fire...
0
9275
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
10040
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
9713
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...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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
6534
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
3806
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
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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.