Tilt-shift Photography : Miniature Fakes

Tilt-Shift miniature faking is a creative technique whereby a photograph of a life-size location or object is manipulated to give an optical illusion of a photograph of a miniature scale model.

Altering the focus of the photography in Photoshop simulates the shallow depth of field normally encountered with macro lenses making the scene seem much smaller than it actually is.

In addition to focus manipulation, the tilt-shift photography effect is improved by increasing color saturation and contrast, to simulate the bright paint often found on scale models.

Most faked tilt-shift photographs are taken from a high angle to further simulate the effect of looking down on a miniature. The technique is particularly effective on buildings, cars, trains and people.

The following websites provide useful informations and tuotials about Tilt-Shift miniature faking :

Some outstanding tilt-shift photos published on flickr under a creative common licence are listed below:

There are currently 142 groups on flickr dealing with tilt-shift. My favorite pools are :

SoundFonts (.sf2)

SoundFont, a registered trademark of E-mu Systems, Inc., is a name that collectively refers to a file format and associated technology to synthesize audio in the context of computer music composition. The exclusive license for re-formatting and managing historical SoundFont content has been acquired by Digital Sound Factory.

A SoundFont file, or SoundFont bank, contains one or more sampled audio waveforms (or samples), which can be re-synthesized at different pitches and dynamic levels. SoundFont banks are related to MIDI devices and can be seamlessly used in place of General MIDI (GM) patches in many computer music sequencers.

The original SoundFont file format was developed in the early 1990s by E-mu Systems and Creative Labs (used in Sound Blaster AWE32). Files in this format conventionally have the file extension of sbk. The SoundFont 2.0 version was released in 1996 and was fully disclosed as a public specification to make it an industry standard. New versions up to 2.4 have been relased in the past years and the new SoundFont files conventionally have the file extension sf2.

There are other sound formats available, e.g. The DownLoadable Sounds (DLS) standardized by the MIDI Manufacturers Association (MMA),  the DLS-Level 2 and the Structured Audio Sample Bank Format (SASBF )standardized by he MPEG standards body in collaboration with MMA and MIT and  proprietary formats developed by Yamaha and other music companies. Nevertheless the sf2-soundfonts became a de-facto standard and are widely used today.

There are a lot of websites available that offer free and commercial sf2 soundfonts :

The following tools are best suited to use SoundFonts :

  • SynthFont : a free midi file player using SoundFonts
  • Viena : a free SoundFont editor
  • FluidSynth : an open source real-time software synthesizer used in several music applications
  • Gervill : a software sound synthesizer for use with the Java Sound API
  • SFPack and SFArk : archivers for SoundFont banks which use different compression techniques

Inline (binary) images, data:URIs and canvas tags

In a typical webpage, images are not embedded in the HTML code, but stored as separate files on the server and requested by individual HTTP GET commands. For different reasons it would be useful to include images in the main web document :

  • to speed up the rendering of the webpage in the browser : 80% of the end-user response time is spent on the front-end by downloading all the components in the page: images, stylesheets, scripts, Flash, etc
  • to minimize HTTP requests and to reduce trafic costs (e.g. when using an Amazon webservices pricing model)
  • to display images created by code (e.g. sparklines)
  • to display images retrieved from a database or from a REST service

In august 1998, L. Masinter from Xerox Corporation published a Request for Comment (RFC 2397) for a Uniform Resource Locator (data:URI) scheme that provides a way to include data in line in web pages as if they were external resources. Although the IETF never formally adopted it as a standard, the HTML 4.01 specification refers to the data URI scheme and data URIs have been implemented in most browsers, but not in Internet Explorer before version 8, which is the major problem of this solution.

An example of a red dot picture embedded in HTML is given hereafter :

<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0 vr4MkhoXe0rZigAAAABJRU5ErkJggg==" alt="Red dot" /> 

Data URIs may contain whitespace for readability.

Another way to embed images in HTML code is the new element <canvas> which is  part of HTML5 and allows for dynamic scriptable rendering of bitmap images. A tutorial about the canvas tag is available at the Mozilla developer center. As for the data:uri, the canvas tag is not supported by Internet Explorer. ExplorerCanvas developed by Erik Arvidsson brings the same functionality to Internet Explorer. To use this solution, web developers only need to include a single script tag in their existing web pages.

<head><!--[if IE]><script src="excanvas.js"></script><![endif]--></head> 

To get the code working, the following additional javascript is needed :

var el = document.createElement('canvas'); G_vmlCanvasManager.initElement(el);var ctx = el.getContext('2d');

The classic solution to display binary images embedded in HTML code is the following :

<html>
<body>
<img src="myimage.php">
</body>
</html>

The corresponding code for myimage.php is :

<?php
header('Content-type: image/jpeg');
// Create image
$image = imagecreatetruecolor($width,$height);
// pick color for the background
$bgcolor = imagecolorallocate($image, 100, 100, 100);
// fill in the background with the background color
imagefilledrectangle($image, 0, 0, $width, $height, $bgcolor);
// output image to the browser
imagejpeg($image);
// delete the image resource
imagedestroy($image);

Be sure that there is no leading whitespace or blank line before the <?php tag, otherwise the displayed result will be of the form

Garbage

One of the first cross-browser methods for incorporating images into self-contained HTML documents was published by Benn P. Herrera in march 2005.  Two years  ago there was not yet a better method avilable. Today the <canvas> tag and the ExploreCanvas JavaScript seems to be the most promising solution to embed binary images in HTML code.

TrueType, OpenType, EOT, WOFF and SVG Fonts

Last update : February 20, 2001
TrueType is an outline font standard originally developed by Apple Computer in the late 1980s as a competitor to Adobe’s Type 1 fonts used in PostScript. TrueType offers font developers a high degree of control over precisely how their fonts are displayed, right down to particular pixels, at various font heights.

OpenType is a format for scalable computer fonts which is built on TrueType, retaining TrueType’s basic structure and adding many intricate data structures for prescribing typographic behavior.

Other font types are :

  • Embedded OpenType (EOT) fonts are a compact form of OpenType fonts designed by Microsoft for use as embedded fonts on web pages. These files usually use the extension “.eot”.
  • Web Open Font Format (WOFF) is a font format, based on the sfnt file structure (used in TrueType and OpenType fonts) and specifically designed for web use with the @font-face declaration. It was developed by Jonathan Kew (Mozilla Corporation), Tal Leming (Type Supply) Erik van Blokland (LettError).
  • SVG Fonts are supported in the W3C spec (http://www.w3.org/TR/SVG11/fonts.html).

The following links give access to Font libraries :

A @fontface generator is available at the Font Squirrel website. A very useful guide about font embedding has been published by Joshua Johnson on the Six Revisions website. A guide about the Google Font API has been published by Divyang Patel on the same website. How to achieve cross-browser @font-face support is the title of a tutorial published on the website lost in the woods.

Sparklines and SpriteMe

The term Sparkline was proposed by Edward Tufte for small, high resolution graphics embedded in a context of words, numbers, images. Tufte describes sparklines as data-intense, design-simple, word-sized graphics. Sparklines present trends and variations associated with some measurement, such as average temperature or stock market activity, in a simple and condensed way.

A Sparkline PHP Graphing Library has been developed by James Byers who edits alos a wiki about this topic.

jQuery plugin developed by Gareth Watts generates sparklines directly in the browser using data supplied either inline in the HTML, or via javascript.

Joe Gregorio created a sparkline generator. You can start right away by dynamically creating a sparkline using the Sparkline Generator Web Application or you can download the spark.cgi code written in python and running the sparkline service on your own server. Joe Gregorio published a contribution about sparklines (A Bright, Shiny Service: Sparklines) in june 2005. Another sparkline builder has been developed by Mark Pursey. Will Larson created a a simple javascript utility for building sparklines.

Most sparklines are embedded in webpages with data:URIs (RFC 2397) which are not implemented in Internet Explorer lower than version 8. The sparklines are not displayed with those browsers.

Sparklines are also part of the Google Visualization API which works also with Internet Explorer.

Other useful links about sparklines are :

Another technique to reduces the number of downloads in a webpage are sprites. A sprite combines multiple background images into a single image. Steve Souders developed a bookmarklet (javascript file) called SpriteMe to add this functionality to webpages.

Amazon S3 php source code

The basic php file provided by Amazon AWS in 2006 and updated in 2007 to manage S3 accounts requires the PEAR modules Crypt_HMAC and HTTP_Request.

Today there are several php open source toolkits available which are well documented, easy to set up and offering extended features :

  • undesigned S3 php class :  a standalone Amazon S3 REST implementation for PHP 5.2.x (using CURL), that supports large file uploads and doesn’t require PEAR. The latest version is 0.4.0 published on july 20, 2009. The developer is Donovan Schonknecht, a web/mobile application developer based in Cape Town, South Africa. The sourcecode is available at the Google Code website.
  • Tarzan : a fast, powerful PHP toolkit for building web applications with Amazon Web Services. The latest version is 2.0.5 released on august 14, 2009. The developer is Ryan Parman. The sourcecode is available at the Google Code website. User Metadata is managed if the HTTP header has the prefix x-amz-meta- (example: header : x-amz-meta-city value: Luxembourg).
  • CloudFusion : a rebranded version of Tarzan to better reflect the beyond-Amazon evolution of the product. Tarzan 2.5 will be CloudFusion 2.5 and will come with a refreshed website, documentation, examples, and other goodies. The sourcecode is available at the Google Code website.
  • Amazon GS3 : a stream wrapper to get and send files to Amazon S3, developed by Cesar D. Rodas from Paraguay.

A list of some Amazon S3 php code examples is shown hereafter :

Amazon S3 software clients

Last update : December 10, 2012

To organize/manage/store files on Amazon S3, you need a special software tool.

The following list shows a few selected free 3S clients :

  • S3Fox Organizer : this plugin for the Firefox browser is easy to install. Developed by Suchi Software Solutions, the most recent version is 0.6.
  • S3Browser : this Windows only free S3 tool supports multiple Amazon S3 accounts, S3 metadata editing and bucket sharing on top of other features. The latest version is 3.6.7 and has been released on November 20, 2012. S3 Browser is free for personal use only. Users who run the application in commercial, business, government, or military institutions, or for any other profit activity must purchase a Pro license. The Pro license provides some additional features, e.g. a working user-metadata edition.
  • Cloudberry S3 Explorer : this tool makes managing files in Amazon S3 storage easy. By providing a user interface to Amazon S3 accounts, files, and buckets, CloudBerry lets you manage your files on cloud just as you would on your own local computer. The current version is 3.7 released November 14, 2012. A CloudBerry Explorer PRO version is also available which offers some advanced features over the Freeware version. It makes managing files Amazon S3 easier, more secure and cost efficient.
  • Cyberduck : this open source client is an FTP, SFTP, WebDAV, Cloud Files and Amazon S3 browser for the Mac. It features an easy to use interface with quickly accessible bookmarks. The outline view of the browser allows to browse large folder structures efficiently and you can quickly preview files with Quick Look. (version 4.21 relaesd December 12, 2011)
  • S3fm : this client is the first 100% Ajax file manager application for Amazon S3. It runs directly in your browser as a standalone Javascript application and loads from and communicates directly with Amazon S3 without having to share your access credentials with a 3rd party Web site.
  • Amazon S3 for WordPress : this WordPress plugin (version 0.4) developed by Joe Tan allows you to use Amazon’s Simple Storage Service to host your media for your WordPress powered blog. The plugin was not updated during the last two years.
  • WordPress plugin for Amazon S3 : Donovan Schonknecht created a very simple WordPress plugin for Amazon S3 which uses his Amazon S3 PHP class.

The latest versions of S3Browser and Cloudberry support the new Amazon AWS archive solution Glacier.

There are also some commercial S3 tools available, e.g. JungleDisk, Gladinet Cloud DesktopBucket Explorer, SMEStorage and CrossFTP.

CVS, SVN, Git, Mercurial, Trunk, Tags, Branches, Forks ?

CVS (Concurrent Versioning System) is a free software revision control system in the field of software development. Version control system software keeps track of all work and all changes in a set of files, and allows several developers to collaborate. Dick Grune developed CVS in the 1980s.

CVS became popular in the open source software world and is released under the GNU General Public License. In the early 2000s, many users of CVS began to replace it with Subversion (SVN), which was explicitly designed to circumvent some of the limitations of CVS. As of January 2009, many open source projects have replaced Subversion or CVS with a distributed version control system, such as Git or Mercurial.

Subversion, as an open source version control system, will become a project of the Apache Software Foundation and remains of interest for a lot of projects.

Trunk, Tags and Branches are names of directories commonly used in revision control systems, but there exist no agreed definition. I have the following understanding:

  • Trunk : Main development area. This is where the next major release of the code lives, and generally has all the newest features.
  • Branches : Every time a major version is released, it gets a branch created. This allows developers to fix bugs and to make a new release without having to release the unfinished or untested features.
  • Tags : Every time you release a version (final release, release candidates (RC), and betas) you make a tag for it. This gives you a point-in-time copy of the code as it was at that state, allowing you to go back and reproduce any bugs if necessary in a past version, or re-release a past version exactly as it was.
  • Forks : Separate projects that share a common origin with other source code,e.g. major branches that are not accepted into the trunk by the project stakeholders.

A discussion about this topic can be viewed at the stackoverflow website, more detailed informations are available in the conference paper Streamed Lines: Branching Patterns for Parallel Software Development.

Export Sims from the Sims 3 game

There are two ways to export Sims from the Electronic Arts Sims 3 game:

  • in a .sims3pack-file created in the folder My DocumentsElectronic ArtsThe Sims 3Exports when you “share sim”
  • in a .sim-file created in the folder  My DocumentsElectronic ArtsThe Sims 3SavedSims “when you save sim to bin”

To export or to save any sim in game, take them to a mirror, select “change appearance” to load your sim into CAS, look down at the bottom of the screen at the little square portrait of your sim with the options dots in the corner, click the dots and choice the option “share sim” or “save to bin”.

Les formats .package et .sims3pack de Sims 3

Sims 3 utilise deux formats pour regrouper les fichiers avec les resources et données du jeu :

  • les fichiers .package sont les fichiers du jeu eux-même
  • les fichiers .sims3pack sont de mini-executables contenant un ou plusieurs .package

Pour télécharger des contenus en format .package,  il faut installer le fichier Resource.cgf dans le répertoire:

C > Program Files > Electronic Arts > Les Sims 3.

et les fichiers téléchargés dans le répertoire :

C > Program Files > Electronic Arts > Les Sims 3 > Mods > Packages > dossier 1 > dossier 2 > dossier 3  (maximum 3 niveaux de sous-dossiers)

Le logiciel Install Helper Monkey permet d’installer d’une façon conviviale les téléchargements au format .package.
En double-cliquant sur un fichier .sims3pack, l’utilitaire associé (le lanceur du jeu Sims 3) installe les données au bon endroit. Pour enregistrer les données d’uen façon plus contrôlée, on peut recourir au programme S3PME.