Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Multimedia JPEG
I wanna want to write a program which can rotate image, substract, add two image but I don't know how to read and write to JPEG file, and I do not know the format of JPEG file. Can someone help me?
Posted 27-Jun-13 6:46am
Edited 27-Jun-13 10:37am
CHill6066.9K
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You don't need to know the format of the JPEG files for manipulating them. You may, for instance load (and manipulate) them using GDI+ (see, for instance "Rotating, Reflecting, and Skewing Images"[^]).
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

If GDI+ is not an option for you, then I would recommend to use one of the many libraries for converting image formats. For example this one:
 
CxImage[^]
 
That doesn't mean you should not have a look at the JPEG specification, as Harvey suggested in Solution 2. It just means that the JPEG standard is not trivial to understand implement and you might end up with a couple thousand line of C++ code. So for faster results you might want to use a good library.
 
A word about rotation. You can rotate a JPEG image by converting it into a bitmap, then rotate it (which is quite easy) and then re-encode it as a JPEG. This process is however not absolutely lossless, because JPEG is a lossy compression method. There is however a way of rotating a JPEG image without converting it into a bitmap, just by manipulating the internal data structures. Some libraries support lossles JPEG rotation. Just google for "jpegtran".
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The file format for JPEG and how to build/manipulate one can be found here[^].
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 280
1 Maciej Los 280
2 BillWoodruff 240
3 Afzaal Ahmad Zeeshan 239
4 Sergey Alexandrovich Kryukov 195
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 27 Jun 2013
Copyright © CodeProject, 1999-2014
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