JavaScript Image Optimiser (JSIO)

So, I’ve embarked on a new mini project. It is kind of inspired by image sprites.

Image sprites are a great idea, but come with a whole bunch of issues that make them a bit of a pain to work with.

Firstly, most of the time you have to use markup to create an element in html to “hold” the image you wanted to display from your sprite. This is because if you actually set a sprite as the background image for a large html element you’re likely to see other images in the sprite as well. Because of this, you actually lose useful functionality that CSS gives you, like the ability to position, repeat and scale an image. Also, the markup you’ve created to hold the image exists for style purposes, which is bad.

Secondly, sprites can be a massive ball ache to maintain. If you’ve closely packed your images in a sprite for maximum efficiency and then one of your images needs to change size, you’re either going to have to move ALL images surrounding the image you have to update (and obviously then change all background-position properties for the images you’ve moved) or leave a space and put the updated image in a new position in your sprite.

How do you know which images in a sprite are used and which ones are dead? Since your images are referenced by coordinates, this sort of clean up becomes a nightmare and is actually a bit lot of a nightmare to create image sprites in the first place.

The goals of the project are to

  1. Reduce the number of http requests (and their associated header traffic) to the server and hence reduce the time it takes to load all images on a website and bandwidth footprint the site requires
  2. Create a solution that’ll alleviate some of the problems surrounding the creation and use of image sprites
  3. Do something cool

The JSIO project website has a pretty good explanation of how it works so I won’t bore you with the details here. However, as a brief overview, it packages all your image data in data uri format and you reference particular images by their filename rather than their coordinates.

The site actually uses the HTML5 file api to generate your resources file for you, which makes creating and maintaining your JSIO “sprite” really really easy.

I read *somewhere* that data uri encoded images can be up to 1/3 larger than corresponding image files, however with gzip encoding they can be only 0-3% larger (or less). My thesis is that for a site with many small images, JSIO could be more efficient and easier to maintain than having separate files or even an image sprite.

…I’m yet to prove or disprove this and I’ll be conducting some tests whose results I’ll post up here (even if they do prove JSIO to be useless).

Disclaimer: This is the first ever ALPHA release of JSIO – it works on the latest Firefox and Chrome but I haven’t even checked it in IE yet. It probably won’t work in IE yet. Also, the website needs some work for optimal display on mobile devices.

6,719 thoughts on “JavaScript Image Optimiser (JSIO)

  1. Этот медицинский обзор сосредоточен на последних достижениях которые оказывают влияние на пациентов и медицинскую практику. Мы разбираем инновационные методы лечения и исследований акцентируя внимание на их значимости для общественного здоровья. Читатели узнают о свежих данных и их возможном применении. Ознакомиться с теоретической базой – детокс24 краснодар

  2. How to buy Bitcoin online? Visit https://howtobuybitcoin.online/ and you’ll discover that receiving BTC online is easier when you understand the purchase flow before sending money. This guide explains how beginners can choose Bitcoin and complete a more secure online purchase. Use the Bitcoin widget below to estimate how much BTC you can receive, compare order details, and preview the purchase process before confirming the transaction.

  3. Минск нужен. Срочно бля хуево уже надо зарядиться Помогите пожалуйста я здесь ни хрена не понимаю https://neptun40.ru 05 муки и реги 05Покуреха порошки безвкусные на язык остальные горькие. Так проще всего определить.

  4. Looking for a crypto exchange API for websites? Visit https://cryptosdk.io/ and you’ll find CryptoSDK – a crypto exchange API for websites, apps, wallets, and digital services that require a built-in crypto exchange within their own product flow. Instead of sending users to a separate frontend, the integration keeps routing, rate search, verification, validation, order creation, and status tracking within a single product.

  5. Мартин Сад https://www.martin-sad.ru/ – это питомник растений и огромный садовый центр в Москве. Посетите сайт – посмотрите самый полный каталог саженцев и растений предлагаемых нами, а также каталог товаров для сада. У нас множество товаров по Акции! Оказываем услуги посадки растений и ухода за участком. Подробнее на сайте!

  6. SEO Казань: разборы кейсы стратегии роста SEO услуги Казань

  7. Современные путешественники ценят комфорт и надёжность а именно это предлагает сервис трансферов заслуживший доверие тысяч клиентов. Бронирование поездки на https://transfer-easy.ru/ занимает считанные минуты: фиксированная цена от 500 рублей бесплатное ожидание при задержке рейса и встреча с именной табличкой — всё включено. Автопарк компании состоит исключительно из иномарок не старше пяти лет: от комфортных Toyota Corolla до представительских Mercedes S-класса. Водители помогут с багажом а в салоне действует строгий запрет на курение. Путешествие начинается приятно

  8. продавана сегодня в асе вообще ен видел хз что там у них купить кокаин мефедрон гашиш ск Всем местным хорошего вечераЕсли кто-то когда-то пробовал банки с Рафинада на тусиае тот знает как классно они перли и понимает каких эффектов я ожидал.

  9. В этой статье рассматривается комплексный подход к избавлению от зависимости. Читатель узнает, как сочетание физического, психологического и духовного восстановления помогает достичь стойкого выздоровления.
    Ознакомиться с полной информацией – Похмельная служба в Краснодаре

  10. Great work! This is the type of information that are supposed to be shared across the web. Shame on Google for not positioning this submit higher! Come on over and discuss with my site . Thanks =)

  11. Платформа Pabit представляет собой современное решение для управления проектами, позволяющее командам по всему миру сосредоточиться на достижении целей без организационного хаоса. Система предлагает комплексный набор инструментов: детализированное управление задачами с расширенным редактором и возможностью прикрепления файлов, планирование спринтов через циклы, разделение проектов на модули для контроля ключевых вех. Ознакомиться с функционалом можно на https://pabit.ru/, где представлены настраиваемые представления для фильтрации задач, интеллектуальный помощник для работы со страницами и аналитика в реальном времени. Интуитивный интерфейс платформы освобождает руководителей от технических сложностей, позволяя фокусироваться на стратегических аспектах командной работы.

  12. Палево палево с сайтом чооо?? купить кокаин мефедрон гашиш ск Ищи в соседней ветке мой отзыв по рцс. ИМХО рцс не для торча.бро незнаю скок раз брал ни разу TS не подводил входил в положения скидки бонусы делал

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>