Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

December 20 2013

07:30

Exclusive Freebie on Noupe: Human Pictos with 500 Icons of Everyday People


  

It’s that time of the year again. Everybody roams the cities on the hunt for the perfect Christmas present. Our present for you involves no running. Again, we’ve teamed up with Freepik, our friends from sunny Spain, to bring you another freebie. This time we’re giving away a set of 500 icons symbolizing human behavior in loads of everyday situations. Instead of bringing you sparkling Christmas icons that you cannot use anymore in two weeks from now, we decided to go for something more timeless ;-) All of the icons are free to use for any type of project, but you can only get them here…

April 28 2013

11:30

Photoshop in Web Design: 5 Plugins to Make your Workday More Pleasant


  
GuideGuide Still nowadays lots of web designs start as a Photoshop draft. This gets more and more elaborate and has to be converted to HTML and CSS during the late stages of the project. No wonder, that services for PSD to HTML conversion still face no shortage of orders. A lot of developers have created a flood of plugins for facilitating the task of turning PSD to HTML. I went and dug up five of which I opine belong to the best.

April 08 2013

16:45

Exclusive Freebie for Noupe’s Readers: 500 Icons in our Freepik Web Mega Bundle


  
freepik-web-icon-mega-bundle-teaser-w550

Today, we have something to give away for free and we know you’ll like it. The creators of Freepik came up with a big icon-set of 500 symbols and decided to make it available exclusively through our lovely Noupe Magazine. We share it only with our German sister Dr. Web. Read on to learn how to get hold of Freepik’s Web Mega Bundle 500. It’s easy as can be…

August 22 2010

19:30

Want to pack JS and CSS really well? Convert it to a PNG and unpack it via Canvas

Jacob Seidelin of nihilogic fame (remember his Super Mario in JavaScript solution) is one of my unsung heroes of JavaScript. His solutions have that Dean Edwards "genius bordering on the bat-sh*t-crazy" touch that make you shake your head in disbelief when they come out but later on become very interesting.

One of his posts from 2008 entitled "Compression using Canvas and PNG-embedded data" had a good idea: if you want to compress JavaScript and CSS you could reverse engineer a packing algorithm in JavaScript or you could use a lossless packing system that is already in use and supported in browsers. In this case the packed format is PNG and the way to unpack it is by using the canvas API's getImageData() method:

JAVASCRIPT:
var x = function(z, m, ix ) { // image, callback, chunk index
  var o = new Image();
  o.onload = function() {
    var s = "",
        c = d.createElement("canvas"),
        t = c.getContext("2d"),
        w = o.width,
        h = o.height;
    c.width = c.style.width = w;
    c.height = c.style.height = h;
    t.drawImage(o, 0, 0);
    var b = t.getImageData( 0, 0, w, h ).data; //b : bucket of data
    for(var i= 0; i <b.length; i += 4) {
      if( b[i]> 0 )
        s += String.fromCharCode(b[i]);
    }
    m(s, ix);
  }
  o.src = z;
}

As there are quite some interesting competitions going on that need really small JavaScript solutions Alex Le took up Jacob's work and wrapped it in a build script that concatenates, packs and converts to a PNG and unpacks it for the 10K competition with a JavaScript. In the process Alex also found some bug in Internet Explorer 9's canvas implementation as it only reads the first 8192 bytes of a PNG and returns 0 for the others :(.

It is pretty amazing how efficient this way of packing is. What we need to test now is when and if it is worth while to have the unpacking done on the client. Imagine adding your JS and CSS to the end of an image and cropping it in CSS to have all the info you need in an app in a single HTTP request. Let the games begin.

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl