Results 1 to 1 of 1

Thread: Home made Lossy format (quantetization approach)

  1. #1
    Member toi007's Avatar
    Join Date
    Jun 2011
    Thanked 0 Times in 0 Posts

    Smile Home made Lossy format (quantetization approach)

    Hi people for a start IM not a programmer and i made this in blitzbasic
    Im trying for some time to implement a similar to jpg format
    with was previously bmx and failed
    now i just quantetize the values and put them in quantetized.bmp.zpaq
    theres instructions in english in this zip file
    theres the executables and 20 samples
    feel free to test it and use it in 1024x768 jpgs bmp png at your own risk
    the Y value could be from 4 to 20 and the U and V values shoud be 2x the Y and should be equal
    but feel free to test it
    the zpaq.exe -mbmp_j4 c filename.quantetized.bmp.zpaq its the final size
    this its possible as a test thanks to zpaq
    I could not compress the quantetized.bmp so well with stuffit or rar or converted into png
    if you say its acepteble in values of 150kb filesize and poor in 80kb filesize I agree
    Discreet cosene transform its better in JPG
    but I give it a try

    ah a made a improvement in options
    now it got Y gradient range and y inside gradient detail
    for less blur skys but theres still a problem of onfuced backgrounds on compressions bigger in y than 12
    but give it a try i compressed 122 images of jpg of 30 megas
    and Y12 U24 V24 Ygradient force 8 and Y inside gradient 4 and get 20 megas of zpaqed files

    i need to do a table similar to quantitizations in jpg

    theres the updated files

    The explanation of The quantitization

    frist I divide RGB into YUV
    then i use a 8x8 grid of Y U and V
    I store the first point of (x8 (x=0 y=0) (x=8 y=0) and so on
    into red for Y green for U and blue for V
    then i made a gradient of Y U and Y because i can get 4 Key points of
    8x8 then the diference from the real value its puted into each pixel
    plus 128 if its lower or real value if its higher (theres no data loss
    in this mode yet)
    but the diference can de quantitized (divided by a value) that you input
    for instances Y compression value of 12 gives for Y diference of 58
    58/12=4.9 or soo and the integer value of 5 its sored into red value of pixel
    when idecompressed its 5*12=60 a bit diferent from 58 but its goes
    same goes for U and V with compression force value could be like 2x the Y
    and U=V
    I use pixel 1022,767 for store the paremeter 4 and 5
    I use pixel 1023,767 for store the Compression force of Y U V

    Now the Gradient Detail in parameter 4 and 5
    The gradient detail value of 8 (parameter 4) for instances means
    that the 1st point 8x8 and the adjecente 3 (x+8,y) (x+8,y+ (x,y+ can not
    be difenet in abs of the given value.
    if they are the quantitization factor its divided by the deital factor of 1 to 30
    (parameter 5).
    for instances a compression of Y value of 12 (parameter 1) and gradient detail
    (parameter 5) gives a 12/4 that means a quantitization of Y only of 3
    in that square 58/3=19.3 (19) when multiplied by 3 gives intsted of 58 a 57 value
    better than the 60 value.

    Heres some correction aproach of 8x8 grid
    it quantifies the diference

    theres the gridsimilarity.exe file
    theres 20 or more sample files in jpg
    theres the zpaq of course
    theres the blitz basic source file

    there no instructions

    but put the image name of 1024x768 image (sample001.jpg)
    the Y value (0-64)
    the V value (0-100)
    the U value (0-100)
    and creates a zpaq file of hopefully 150kb

    you can delete all the bmps

    to rebuild type the name of the bmp.zpaq into the program

    it creates remade.bmp

    here is for 1920x1200 images

    still 3x worst or more in low compression


    Click image for larger version. 

Name:	comparation.jpg 
Views:	149 
Size:	474.0 KB 
ID:	1992

    I will try to use DCT if someone help me!!!!!
    Last edited by toi007; 4th August 2012 at 14:51. Reason: Updates

Similar Threads

  1. SRep made 6gb archive into 3gb
    By SvenBent in forum Data Compression
    Replies: 13
    Last Post: 10th July 2014, 15:31
  2. Replies: 3
    Last Post: 15th November 2011, 21:41
  3. One lossy BMP format that failed by a lot!
    By toi007 in forum The Off-Topic Lounge
    Replies: 0
    Last Post: 29th June 2011, 01:53
  4. Do you have a 64-bit machine at home?
    By encode in forum The Off-Topic Lounge
    Replies: 22
    Last Post: 4th December 2009, 14:09
  5. A new approach?
    By Kaw in forum Data Compression
    Replies: 28
    Last Post: 13th May 2009, 00:17

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts