Solved

Source code for converting jpg to bmp

Posted on 2000-02-17
6
320 Views
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.
:>)
0
Comment
Question by:lmh110697
6 Comments
 
LVL 2

Expert Comment

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

ftp://ftp.uu.net/graphics/jpeg
0
 

Expert Comment

by:TSMITH
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...

http://www.smalleranimals.com/jpegfile.htm

http://www.codeguru.com/bitmap/index.shtml

0
 
LVL 6

Expert Comment

by:edey
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)


GL
Mike



GL
Mike
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Expert Comment

by:sunsetyang
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:
http://www.cubic.org/source/archive/fileform/graphic/
to see the coding method.
0
 
LVL 9

Expert Comment

by:ShaunWilde
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
0
 

Accepted Solution

by:
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.

http://www.efg2.com/lab/Graphics/BMPJPG.htm
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this tutorial viewers will learn how to create blended and gradiated shapes in Illustrator using the blend tool Draw two shapes, one of them in a different color: Select both and create a blend by going to Object > Blend > Make: Blends can also b…
Learn how to set up basic frames and paths in Prezi and understand the open space that Prezi allows you to create presentations in.

831 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