Source code for converting jpg to bmp

Posted on 2000-02-17
Last Modified: 2013-11-19
I'm looking for source code for
converting from jpg & gif image file to black & white bmp file.

(Windows NT & jdk 1.1.8, or c++)

I need your help.
Thanks in advance.
Question by:lmh110697
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 2539646
Have a look here for the Jpeg source...

Expert Comment

ID: 2557243
This is where I get my routines from. I'm in the process of classing my own format load/save, but jpeg is out of my league at present ;) anyhow, hope these help...


Expert Comment

ID: 2570282
If you know how to load a jpeg/gif, the easiest method it to blt it to a bmp and save the result :)

As far as converting it to b/w (if it isn't already) you have a couple of options:

1)Let windows do it by creating the bmp with a b/w palette
2)do your own conversion, perhaps something like this (for a 24bit bmp)
  result = sqrt(red*red+green*green+blue*blue)*(255/441)


Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Expert Comment

ID: 2607700
You can see the source of Delphi 4's jpeg library if you have Delphi.In Delphi3 it was on the cdrom and written in C.You can check.GIF uses LZW coding,You can visit:
to see the coding method.

Expert Comment

ID: 2696308
here is how I would do it:

use OleLoadPicture to load the image which can then be rendered using the IPicture interface and the Render method.

Because you can render it to any dc including a memory DC you can then save the image to a BMP

This technique will also work for .gif as well

Accepted Solution

aegana earned 50 total points
ID: 2709767
Try this page. There is a Delphi implementation of a program that converts images from BMP to JPG (or from JPG to BMP). It also have the source code.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
3rd party tutorials for design programs. 3 163
Google Fonts Logo Design 2 142
Exdpanding a PNG image 15 79
Online photography 7 132
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this second Micro Tutorial in the series,  viewers will learn more basic shortcuts and functions of Illustrator. In this tutorial you will learn about the eyedropper tool, zoom , ellipses and more.
Add visuals to your Prezi to keep your audience engaged. Learn how to embed images, edit them, and more in this video micro tutorial. Select "Insert" from the top menu in your Prezi editor: Select "Image": A toolbar will pop in from the right …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question