Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
January 29th, 2008, 11:27 PM
|
#1 (permalink)
| | Senior Member
Join Date: Jan 2005 Location: New York
Posts: 884
|
So I'm trying to create an image compression program using binary partitioning, but I really have no idea. Instead of trying to find a program to do that, I just want to see how an image would be compressed using standard lossy JPEG (using DCT).
My problem is that I cannot find source code, or atleast for C#, of an image compression program using JPEG. I mean I tried C++ source code, but I had no idea how to read it (I dont know any C++). Does anyone know such source code, or at least help me get this thing started?
I just need to know how to work with images with programming as I dont have any experience in it. EX: JPEG divides the image into 8x8 blocks, apply transformation, etc, but I have no idea how I'm supposed to divide an image and do mathematical transformations to those blocks.
Any idea, or comment is appreciated.
__________________ Size 1 Rules! |
| |
January 30th, 2008, 12:57 AM
|
#2 (permalink)
| | Banned
Join Date: Jan 2005 Location: Loveland, CO
Posts: 5,493
| Code: for all x in new image (old y * xscale)
for all y in new image (old y * xscale)
array[x][y]=getInterpolation(x*xscale.y*yscale)
return array;
}
var getInterpolation(x,y){
return interpolate(
getVar(floor x,floor y),
getVar(floor x,ceil y),
getVar(ceil x,floor y),
getVar(ceil x,ceil y),
x mod 1, y mod 1
);
}
var getVar(){
block = blocks[x/blocksize,y/blocksize];
return block[x mod blocksize, y mod blocksize];
}
var interpolate(var tl, var tr, var bl, var br,x,y){
//your own interpolate func
//here's a sample
return (tl*x)+(tr*(1-x))*y + (bl*x)+(br*(1-x))*(1-y);
}
You should be able to find source code for Infraview. I believe its GPL.
Last edited by Keymaker : January 30th, 2008 at 01:08 AM.
|
| |
July 3rd, 2008, 01:04 PM
|
#3 (permalink)
| | Junior Member
Join Date: Jul 2008
Posts: 1
|
hi,
i think i have the same problem discussed here.
I have to write an image compression program that compresses the image in blocks of N*N dimension (like jpeg where N=8). For the quantization process, rather then using the jpeg tables, i need to find some other criteria.
I'm stuck here... the only think i now is that the compression of the block is guided by minimun and maximum values of pixels in that particular block.
Does anyone know any transformation function that uses this parameters ? |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |