Archive for the ‘Otaku’ Category

Construction Time Again

Monday, November 16th, 2015

 
That’s the latest robot model I’ve built; this time another from Bandai’s Valvrave series (Valvrave VI to be precise). I know nothing of the manga or anime, only that these kits were cheap (~$20) and look distinctive.

Similar to the other one I made a while back, this is heavy in the sticker and transparent plastic department, but was quick and easy to assemble and looks pretty snappy assembled! 

 
My next project was this LED Christmas tree kit, assembled with a bit of solder and gumption from the pieces shown at left. It rests on a 9V trunk, and flashes prettily when pushed down on. (SFL would recognize this as a slightly larger ‘blinky thing.)
 
It was extremely simple to assemble – especially after the nixie clock from earlier this year. A fun little project for my desk at work! 

 
Lastly one of the new metal miniature Star Wars kits, this time the ‘Special Forces Tie Fighter’ from The Force Awakens. I love the new Tie design and was looking forward to making this kit.

But the difficulty was as high – higher even! – than any of the other kits of this type and I hated putting it together! Before you consider buying this one yourself, make sure you have high precision tools, superb lighting, invulnerable skin and the patience of a saint. Even then you’ll make unfixable mistakes like I did….

But it looks pretty great doesn’t it?

JPEG Musings

Tuesday, November 3rd, 2015

Warning: This post is dense with extreme nerdery. Read at your own risk!

I occasionally send my brother quiz questions via text, and as part of a ‘programmers quiz’ I asked him the following last week: “What is the theoretical smallest possible size for a 1024 x 768 jpg image file?”  As befits his ‘coding maestro’ status I expected – and received –  a quick reply: 1024 bytes. I immediately knew he was guessing, and – sadly – incorrect.

The trouble is I didn’t know the answer. Here right now I’ll attempt to work it out.

Bit of a backstory here: over a decade ago one of the first bits of coding work I did at school was write a piece of software to convert .tiff image files into Excel spreadsheets. It was a bit nifty I believed, especially as the .tiff format was a bit messy and it was my first time running up against the rather hoggish memory requirements of very large Excel files (to which I had to develop a workaround). When I did that I developed a bit of an academic interest in the structure of image files, so my question to B didn’t just come from nowhere.

Starting research into this problem led quickly to the discovery that there are quite a few different types of JPEG file, each with slightly different header structures…

Actually lets go back a bit. Only a portion (admittedly the largest portion) an image file corresponds to the actual image itself. The rest is markers – pieces of information that detail the file type, the file structure and the contents. Think of them like the cover and table of contents of a book, where the actual story (in the book) corresponds to the image data.

In terms of image files, JPEG (for Joint Photographic Experts Group) refers to a technique of compressing data to store information in a smaller size. The mechanics of the compression itself are interesting, and can be thought of as reproducing the data using pre-determined blocks to minimize space. Think of rebuilding a house in lego. It will look basically the same, especially from a distance, but up close you’ll notice all sorts of differences. JPEG compression has the same effect on data. This is problematic for important data (such as executables) but ok for images, which is why JPEG has become the image file standard.

There are a few related versions of JPEG files, which can be grouped into two broad groups: JFIF and EXIF. The difference is in the markers and the exact compression techniques. You could spend ages studying the details, but here I’m just trying to create the smallest file possible so the answer is to go with a JFIF file because they take fewer bytes.

So my question becomes: “What is the theoretical smallest possible size for a 1024 x 768 JPEG/JFIF image file?

Let’s methodically go over the barest minimum requirements:
– 2 bytes are required for the standard JFIF header (FF D8)
– 18 bytes are required for the mandatory APP0 marker segment. The actual size is 18+3n bytes where n is the dimension of the (square) thumbnail, but since size matters here I’ll skip the thumbnail (ie. n can equal 0).
– 2 bytes are required to mark the start of image data
– N bytes are then dedicated to the image data
– 2 bytes are required to end the image data

Presumably the above is enough. So it seems the answer so far is “24 + N bytes” where N are the bytes required for the compressed image data.

So how to calculate N? Well the compression method itself is deliciously complex, and requires rebuilding the data using only the following 64 8×8 blocks:

Dctjpeg

Since the file would be a monochrome (to reduce the required number of blocks) file of dimension 1024 x 768, then it would require (1024/8)x(768/8) or 128 x 96 blocks at maximum compressed. Obviously the block used would be the solid one at top right, but the question is can JPEG compress even further than simply saying (in code): “96 rows of 128 solid blocks in a row”? One would imagine yes.

Putting that aside for a moment, the following 134 byte file is (apparently) the smallest possible JPEG image file (a 1 x 1 image of a single grey pixel; obtained from a few places online):

FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 48 00 48 00 00
FF DB 00 43 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF C2 00 0B 08 00 01 00 01 01 01
11 00 FF C4 00 14 10 01 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 FF DA 00 08 01 01 00 01 3F 10

Now if a 1024 x 768 file used 12288 (solid) blocks to recreate the image (at one byte each) and then the 24 required marker bytes are added you’ve then got a 12312 byte file. This is about 92 times the above, which isn’t bad for an image 786432 times larger. But more bytes must be required, since according to my quick calculations the 1 x 1 file would only need 25 bytes, but instead uses 134. This is mostly due to the inclusion of the non-mandatory but always apparently used DQT, SOF and DAC markers that index the compression and quantization used. So the extra 109 bytes should probably be included as an approximation to the larger file of the original problem.

This gives a filesize of about 12397 bytes, or about 12.1k.

And yet. And yet this must be wrong. For instance the values 1024 and 768 can be stored in 2 bytes each, the colour (black?) another byte, and the block used another. Couldn’t the data be compressed to only 6 bytes? Obviously not, based on the 1 x 1 file. And obviously not, based on these:

black blue

Both of them are solid 1024 x 768 JPEG files. The one on the left is 12.3k (according to Mac OS 10.9.5), the one on the right is 12.9 k. Note that the first example is very close to my estimate.

black2

Thats a solid black JPEG I created myself. It’s 16k according to this computer, which tells me Apple adds a bunch of unnecessary marker information to the file (which is common).

So based on my quick calculations, a few educated guesses, and some examples, I’m going to state that the answer to the question is somewhere between 12 and 13k.

At this point you may be tempted to question the utility of JPEG as a technique to compress simple files like these. Consider the extreme example of a book that contained just the word ‘horse’ 50,000 times. Such a book would run to 200 pages long on average. But you could ‘compress’ it to a single sentence that simply read “Horse fifty-thousand times.” and save a lot of paper. My argument here is that 12288 bytes is an awful lot for something that could be compressed down to only 6 bytes using my method above.

I don’t know the answer except to speculate that JPEG is a compression technique useful for the vast majority of image files. As with all things though, there are exceptions, and if the standard is evaluated solely in terms of it’s ability to reduce the file size, then the gains for degenerate examples (such as these) may not be as great as using another standard (such as GIF).

As a final note, reading about the JPEG format as I have this past week has convinced me of two things:
– The actual mathematics behind the transformations of the data to compress it is fascinating.
– Writing code to actually transform a 1024 x 768 solid block of color and generate the compressed data would be akin to reinventing the wheel πŸ™‚

I hope this answer to an idle question is enough for my brother!

Con Swag

Tuesday, October 20th, 2015

We bought a bunch of stuff at the con. Here’s a selection:

IMG_2590

That’s issue 1 of a magazine that ran for only 3 issues back in 1967. It’s basically a girls romance comic with some ‘true love advice’ and articles about dreamy male celebrities of the era. Some guy was selling scads of all three issues of this, probably found in an abandoned warehouse.

IMG_2592

KLS bought this disapproving cat plush. I think it’s disapproval is due to it being the smallest and cheapest plush we bought at the con πŸ™‚

IMG_2582 IMG_2584

I got these 4 old D&D Modules for a song. To my surprise, one of them is a single-player version that uses invisible ink to hide the events! Only two squares in the entire book have been inked in. I wonder if the remaining ink still works?

IMG_2586

Autographed Chris Achilleos art, now framed and on my wall. The guy I bought this from (I also got an Achilleos poster) knows the artist, and was telling me how friendly and gracious he is. He said he had another print somewhere in his voluminous stand, and I was hopeful for some FF or DW art, but alas he couldn’t find it πŸ™

IMG_2595

More art, this time a lenticular Miku poster. See how her blue matches the colour of my study wall! We bought a lot of art at the con, from posters to prints to autographed works. Much of it is already framed and up on our walls (or KLS’s office wall).

IMG_2578

Speaking of Miku, here’s the con-exclusive Nendroid they were selling at the Good Smile booth. It’s super cute, and somehow ended up leaving the con with me πŸ˜‰

IMG_2574

KLS purchased this tiny ‘sea bunny’ resin figure direct from the artist.Β  It is based on the recently discovered ‘sea bunny’ species of nudibranch slug, which looks like this:

slug

So cute! We stumbled upon this fortuitously, since the artist was only there for an hour and only selling 25 of them. I guess he’s somewhat famous since the person in front of us was very excited and had some of his other stuff for him to autograph. He was friendly and seemed genuinely happy people were buying his stuff.

Last but not least, could this be the find of the show:

IMG_2579

All 36 packs, unopened! A world of spice and worms and Gom Jabbers and Kwisatz Haderachs just waiting to be uncovered! Plus there are stickers too. Even though they are already 31 years old I’ll let them age a bit before eagerly ripping into all of them…

…unless you want a pack for your very own self? If so, let me know in the comments.

NYCC 2015 Day 4

Sunday, October 11th, 2015

  
Since we could only stay at the con a few hours today we focused on one last sweep of the main hall (well, about a third of it) and some last minute purchases. 

 
As always I love the vintage and the unusual, and were it not for getting sidetracked by a pile of ancient D&D modules (all of which I then bought) I nearly purchased a crazy expensive boxed Ultraman villian from the 80’s.

I didn’t buy this though: 

 
Or any of these: 

 
And certainly not this: 

 
I have to say though, I love that someone’s even trying to sell that. Yet another reason this con is so much fun.

I haven’t spoken of our celebrity sightings yet. Aside from the X-files panel, we probably saw fewer this year than ever before, and much of the sightings were like this: 

 
There were also much fewer people signing autographs this year as well, which may have been good because I doubt anyone could have topped the bizarre John deLancie from last year πŸ™‚

Eventually, it was time once again for us to turn our backs on the con and head home. 

 
Since it’s KLS’s birthday today, we had sprung for a first-class room on the train home! It was cozy and comfortable, and came with a delicious meal in the dining car! 

 
Doesn’t she look happy!!

After four long and packed days we’re super tired, but once again we had a great time at NYCC. I’ll follow up in a few days with a post about some of the unusual loot we brought home with us…

NYCC 2015 Day 3

Saturday, October 10th, 2015

  
We awoke early and headed down the con to line up at 9 am for a bracelet that would get us into a panel over four hours later. Then we lined up for another bracelet to get us into another panel starting over nine hours later. All this took over two hours and while frustrating and boring is typical of Saturday – the day of lines – at this con. 

 
We spent the couple of hours we had in Artists Alley buying prints before heading back to the main hall and lining up again for the first panel which was The X-Files.

And it was amazing!

We got to see the entire first episode (which screens next year) and it vastly exceeded our expectations. It was followed by a panel featuring Mulder (Duchovny) and Skinner (Pileggi) and series creator Chris Carter himself. 

 

Since they didn’t want the episode leaking online security was very tight and included guys watching the audience through night vision goggles (!) to spot anyone trying to record it! Surreal… 

 
The afternoon was the usual con overload, gawking and buying and dealing with the intense crowds. No matter how much you walk around there’s always something new to be seen! 

 
Many things were bought, both for us and others. Dozens of 3DS street passes were obtained. Swollen feet throbbed in agony. 

 
We headed out for some dinner and to drop our loot off at the hotel. 

 
We returned for the cosplay contest, which was a lot of fun. Leaving the con after it has closed looks like this: 

 
Tomorrow – KLS’s birthday! – is the last day of this years con. Even after over 20 hours on the show floor there’s still things we want to have a closer look at. Since we’ve only got a few hours before our train, it’ll be a busy morning indeed!