Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
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 2483 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)

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.

< Input
(Original.jpg) 5,826 kb (3264x2448)
> Output
(Initial-encrypt.jpg) 5,826 kb (3264x2448)
(Initial-decrypt.jpg) 966 kb (3264x2448)

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

Or did I just make a new tool?

Offline moogie

JGO Ninja

Medals: 16
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?

Java4k RIP 2014
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.

Offline Best Username Ever

Junior Devvie

« 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  

EgonOlsen (37 views)
2018-06-10 19:43:48

EgonOlsen (20 views)
2018-06-10 19:43:44

EgonOlsen (39 views)
2018-06-10 19:43:20

DesertCoockie (186 views)
2018-05-13 18:23:11

nelsongames (122 views)
2018-04-24 18:15:36

nelsongames (121 views)
2018-04-24 18:14:32

ivj94 (861 views)
2018-03-24 14:47:39

ivj94 (122 views)
2018-03-24 14:46:31

ivj94 (758 views)
2018-03-24 14:43:53

Solater (139 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!