TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:3467] GIMP and arbitrary/raw files



> Well, I just tried adding a GIF header to a copy of /proc/kcore. Actually
> I did that a whole ago - loading it into gimp totally killed my computer.
> Apparently loading an image the size of your RAM, which has illegal
> characters in it, is not a good idea...

It works fine here, but I'm using pnm.

> 
> Anyway, if you MUST do it, I'd try forcing a RAW image format ting on top
> of your file, and load it in XV which supports that.
> 

Here are some instructions.

Create a file, first.  I use this to get /proc/kcore, as root:

dd if=/proc/kcore of=biggy bs=1024k count=256

Now, that's only 256MB, since I only have that much RAM.
If you want something bigger, you might want to dd off of
a hard drive or something.  

So it's 1024*1024*256=268435456 bytes.

Now, solve this:

height*width*3 = 268435456
height*width   = 89478485  (round down)

If you want a square image, then

width = height
height = 9459  (again, round down)

So, then do this:

echo "P6" > biggy.pnm
echo "# CREATOR: This is by hand!" >> biggy.pnm
echo "9459 9459" >> biggy.pnm
echo "255" >> biggy.pnm
cat biggy >> biggy.pnm

gimp biggy.pnm 

Note that last step is going to create a huge swap file in your home
directory (bigger than the image, at least), but GIMP on my machine
took only about 24MB memory.  You machine might not die, but GIMP 
itself will be quite slow with that large of a file.

Ok, here is a screenshot of GIMP having loaded /proc/kcore on
my machine, zoomed for security reasons.  ;-)

http://www.gimp.org/~amundson/kcore.gif

Have fun,

-Shawn

--
Shawn T. Amundson               
amundson@gimp.org               http://www.gimp.org/~amundson

"The assumption that the universe looks the same in every
 direction is clearly not true in reality." - Stephen Hawking