Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Image Encryption + Decryption = Smaller Image?]  (Read 1144 times)
0 Members and 1 Guest are viewing this topic.
Offline GabrielBailey74
« Posted 2013-01-06 08:02:46 »

Hey JGO, I'll Start this post off by saying that I've never really messed around with creating/recreating Buffered Images via pixel data before.
(So maybe this is a common ordeal?)  Shocked

I was bored today Emo, and decided to make a program that would:

A: Scan a Image, get the pixel data.
B: Export the recreated Image (.JPG).
C: Encrypt the recreated Image (.IDX / .DAT).
D: Export the decrypted image (.IDX > .JPG).

The Image that I'm using: (rather large)
http://edmullen.net/test/imagefiletest.php

Somehow during this process after I recreate the Image via the decrypted file's data, it reduced the size dramatically?
No Image Quality / Pixel Data Loss.

1  
2  
3  
4  
5  
6  
< Input
(Original.jpg) 5,826 kb (3264x2448)
> Output
(Initial-encrypt.jpg) 5,826 kb (3264x2448)
(Initial-decrypt.jpg) 966 kb (3264x2448)
Finished...!


Is Java doing something that I'm missing?  Stare Stare


Or did I just make a new tool?

Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #1 - Posted 2013-01-06 08:07:03 »

just to be sure have you actually done a per pixel comparison to confirm no difference between the two images?

Offline GabrielBailey74
« Reply #2 - Posted 2013-01-06 08:20:15 »

One second I'm scanning and comparing them.
7,990,272 pixels O.O will it be a while? Emo

EDIT: No pixel loss what so ever was the result Grin

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jonjava
« Reply #3 - Posted 2013-01-06 09:41:59 »

Is java doing something that you're missing? Probably not.

What happens is whatever is written in the code. Since I can't see the code I've no idea.

Most likely it does exactly what you said. It scans the pixel data and recreates the image. Scraping off all other "unnecessary" bytes from the original. I'm not too familiar with the different image standards but I imagine it's more or less like converting a jpeg into a png image.

Why the size difference is so significant I don't know since, as I said, I'm not familiar with the jpeg standard in detail.

Could be that the original jpeg has other stuff compressed within than just pixel data, try extracting it.

http://lifehacker.com/282119/hide-files-inside-of-jpeg-images

Offline Best Username Ever

Junior Member





« Reply #4 - Posted 2013-01-06 17:15:03 »

JPEGs can store a lot of ordinary non-pixel data. Comments and other EXIF data for example. Progressively loading images store more information than non-progressive images. That image apparently also has its own color profile built into it (though I don't know what that means.) Saving it in another program seems to strip data the same way. I got the file size down to 2MB simply by doing that.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (15 views)
2014-09-19 03:14:18

Dwinin (33 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (80 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (63 views)
2014-09-08 06:06:29

BurntPizza (46 views)
2014-09-07 01:13:42

Longarmx (33 views)
2014-09-07 01:12:14

Longarmx (37 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!