Rss Feed
Facebook button
Reddit button
Delicious button

Archive for the 'webdev' Category

Page 3 of 3

Poor-man’s sepia conversion


Working for Pixagogo makes digital imagery my daily bread, and I fool around with images every now and then. I am, however, not a user of PhotoShop. I’ve never worked with it, I don’t own the software, nada. Keep that in mind while you continue reading this.

Recently, for my cousin’s filmfilostoverij blog, I converted some film snapshots into small thumbnails like the one on the right (from “Lucia y el sexo”). The program I use for conversion is IrfanView. Not the best program, not the most complete, but easy, stable and free. For the stuff I need to do, I find Gimp too complex.

What I did to the images was:

  1. crop a square part of it
  2. convert to grayscale
  3. resize to 400×400 px
  4. perform a median filter (value: 9)
  5. resize to 100×100 px
  6. Save as JPG

But then I wanted to have a ‘sepia‘ effect. Irfanview does not have it. I wanted it. So I began my quest.


I started with the ‘Enhance Colors’ function and added 64 ‘R’ and 16 ‘G’ to the B/W image, but that didn’t look real enough. What does sepia look like, anyway? I found two definitions, expressed in CMYK coordinates, that I converted to RGB with my CMYK-to-RGB converter hizmo (thanks to Wikipedia):

The color
1. \definecolor{Sepia}{cmyk}{0,0.83,1,0.70} (from TexCeh)
#4D0D00 (77,13,0)
2. sepia cmyk(0%, 60%, 81%, 63%) (from december.com)
#5E2612 (94,38,18)
In ‘websafe‘ colors, this would be:
#551100 (84,17,0)

So let me show you how I proceeded, using an image of my tango teachers, Marisa y Oliver:

original image
Original
  1. Convert to greyscale
  2. Enhance colors: 94-38-18 (#5E2612)

=> way too red!

  1. Convert to greyscale
  2. Enhance colors: 77-13-0 (#4D0D00)

=> color OK, but too light

  1. Convert to greyscale
  2. Enhance colors: 77-13-0 (#4D0D00)
  3. Add 50% contrast

=> looks great

    Compare this with the optional QuickSepia plugin

=> I like mine better

Voila, there it is, a simple poor-mans sepia, that can even be used in ‘batch convert’ (Irfanview).

Short CMYK/RGB explanation and Detailed CMYK/RGB explanation

[Listening to: "The Prettiest Thing" - Norah Jones - Feels Like Home]

My online charmap of HTML character entities

Geeky as hell, but I need it quite often, and what better place to put it but here: the list of 250+ HTML character entities.
Handy if you would want to write σ = ¾ • ∑ ƒ(χ²) – or your name like "πετερ"

UPDATE: now an even more complete overview can be found on Online Character map. Convert your own text to HTML-encoded with HTML encode.

A
á : [á] – Á : [Á] – â : [â] – Â : [Â] – ´ : [´] – æ : [æ] – Æ : [Æ] – à : [à] – À : [À] – ℵ : [ℵ] – α : [α] – Α : [Α] – & : [&] – ∧ : [∧] – ∠ : [∠] – å : [å] – Å : [Å] – ≈ : [≈] – ã : [ã] – Ã : [Ã] – ä : [ä] – Ä : [Ä]

B
„ : [„] – β : [β] – Β : [Β] – ¦ : [¦] – • : [•]

C
∩ : [∩] – ç : [ç] – Ç : [Ç] – ¸ : [¸] – ¢ : [¢] – χ : [χ] – Χ : [Χ] – ˆ : [ˆ] – ♣ : [♣] – ≅ : [≅] – © : [©] – ↵ : [↵] – ∪ : [∪] – ¤ : [¤]

D
† : [†] – ‡ : [‡] – ↓ : [↓] – ⇓ : [⇓] – ° : [°] – δ : [δ] – Δ : [Δ] – ♦ : [♦] – ÷ : [÷]

E
é : [é] – É : [É] – ê : [ê] – Ê : [Ê] – è : [è] – È : [È] – ∅ : [∅] –   : [ ] –   : [ ] – ε : [ε] – Ε : [Ε] – ≡ : [≡] – η : [η] – Η : [Η] – ð : [ð] – Ð : [Ð] – ë : [ë] – Ë : [Ë] – € : [€] – ∃ : [∃]

F
ƒ : [ƒ] – ∀ : [∀] – ½ : [½] – ¼ : [¼] – ¾ : [¾] – ⁄ : [⁄]

G
γ : [γ] – Γ : [Γ] – ≥ : [≥] – > : [>]

H
↔ : [↔] – ⇔ : [⇔] – ♥ : [♥] – … : […]

I
í : [í] – Í : [Í] – î : [î] – Î : [Î] – ¡ : [¡] – ì : [ì] – Ì : [Ì] – ℑ : [ℑ] – ∞ : [∞] – ∫ : [∫] – ι : [ι] – Ι : [Ι] – ¿ : [¿] – ∈ : [∈] – ï : [ï] – Ï : [Ï]

K
κ : [κ] – Κ : [Κ]

L
&lambda; : [λ] – &Lambda; : [Λ] – &lang; : [⟨] – &laquo; : [«] – &larr; : [←] – &lArr; : [⇐] – &lceil; : [⌈] – &ldquo; : [“] – &le; : [≤] – &lfloor; : [⌊] – &lowast; : [∗] – &loz; : [◊] – &lrm; : [‎] – &lsaquo; : [‹] – &lsquo; : [‘] – &lt; : [<]

M
&macr; : [¯] – &mdash; : [—] – &micro; : [µ] – &middot; : [·] – &minus; : [−] – &mu; : [μ] – &Mu; : [Μ]

N
&nabla; : [∇] – &nbsp; : [ ] – &ndash; : [–] – &ne; : [≠] – &ni; : [∋] – &not; : [¬] – &notin; : [∉] – &nsub; : [⊄] – &ntilde; : [ñ] – &Ntilde; : [Ñ] – &nu; : [ν] – &Nu; : [Ν]

O
&oacute; : [ó] – &Oacute; : [Ó] – &ocirc; : [ô] – &Ocirc; : [Ô] – &oelig; : [œ] – &OElig; : [Œ] – &ograve; : [ò] – &Ograve; : [Ò] – &oline; : [‾] – &omega; : [ω] – &Omega; : [Ω] – &omicron; : [ο] – &Omicron; : [Ο] – &oplus; : [⊕] – &or; : [∨] – &ordf; : [ª] – &ordm; : [º] – &oslash; : [ø] – &Oslash; : [Ø] – &otilde; : [õ] – &Otilde; : [Õ] – &otimes; : [⊗] – &ouml; : [ö] – &Ouml; : [Ö]

P
&para; : [¶] – &part; : [∂] – &permil; : [‰] – &perp; : [⊥] – &phi; : [φ] – &Phi; : [Φ] – &pi; : [π] – &Pi; : [Π] – &piv; : [ϖ] – &plusmn; : [±] – &pound; : [£] – &prime; : [′] – &Prime; : [″] – &prod; : [∏] – &prop; : [∝] – &psi; : [ψ] – &Psi; : [Ψ]

Q
&quot; : ["]

R
&radic; : [√] – &rang; : [⟩] – &raquo; : [»] – &rarr; : [→] – &rArr; : [⇒] – &rceil; : [⌉] – &rdquo; : [”] – &real; : [ℜ] – &reg; : [®] – &rfloor; : [⌋] – &rho; : [ρ] – &Rho; : [Ρ] – &rlm; : [‏] – &rsaquo; : [›] – &rsquo; : [’]

S
&sbquo; : [‚] – &scaron; : [š] – &Scaron; : [Š] – &sdot; : [⋅] – &sect; : [§] – &shy; : [­] – &sigma; : [σ] – &Sigma; : [Σ] – &sigmaf; : [ς] – &sim; : [∼] – &spades; : [♠] – &sub; : [⊂] – &sube; : [⊆] – &sum; : [∑] – &sup; : [⊃] – &sup1; : [¹] – &sup2; : [²] – &sup3; : [³] – &supe; : [⊇] – &szlig; : [ß]

T
&tau; : [τ] – &Tau; : [Τ] – &there4; : [∴] – &theta; : [θ] – &Theta; : [Θ] – &thetasym; : [ϑ] – &thinsp; : [ ] – &thorn; : [þ] – &THORN; : [Þ] – &tidle; : [&tidle;] – &times; : [×] – &trade; : [™]

U
&uacute; : [ú] – &Uacute; : [Ú] – &uarr; : [↑] – &uArr; : [⇑] – &ucirc; : [û] – &Ucirc; : [Û] – &ugrave; : [ù] – &Ugrave; : [Ù] – &uml; : [¨] – &upsih; : [ϒ] – &upsilon; : [υ] – &Upsilon; : [Υ] – &uuml; : [ü] – &Uuml; : [Ü]

W
&weierp; : [℘]

X
&xi; : [ξ] – &Xi; : [Ξ]

Y
&yacute; : [ý] – &Yacute; : [Ý] – &yen; : [¥] – &yuml; : [ÿ] – &Yuml; : [Ÿ]

Z
&zeta; : [ζ] – &Zeta; : [Ζ] – &zwj; : [‍] – &zwnj; : [‌]

Port redirection in Windows

We use port redirection/proxy often on our platforms. In the production setup, separate (Linux-based) servers take care of this, but for our development and testing environment, we need port redirection for Windows system. I generally use 2 command-line packages:

  • stunnel.org: TCP proxy for adding or removing TLS (tunnel encryption aka SSL) from a stream
  • rinetd: plain TCP proxy for that accepts TCP connections and just transfers them to another TCP/IP address/port

    Typical use of stunnel:

  • adding TLS to a non-secure server (you will need a server certificate for this), HTTP to HTTPS, SMTP to SMTPS, POP3 to POP3S, FTP to FTPS, … stunnel -d smtps -r localhost:smtp
  • adding TLS to a non-secure client, e.g. a mail client without SMTPS
  • tunnel an existing non-TLS capable protocol through a TLS tunnel (e.g. DNS)

    Typical use of rinetd:

  • transfer a site on port 8080 to another IP address on port 80, to get rid of server:8080 side effects
  • transfer a port 88 to port 80, so you can have different Network Load Balancing policies on both ports, while they both run off the same site

    Claire Forlani
    Meanwhile on the other screen: Claire Forlani in ‘Meet Joe Black’. Mediocre movie, lousy acting by most of the crew, but mmmmm, that face.