Way back, I did some experiments to resize pixel graphics (black and white), while retaining the 1 pixel line width, but correctly resizing things that had "volume".
I did it like this:
- Cut the image in 1 pixel horizontal strips.
- Go over the line, adding object start-X and end-X pixel color.
- Resize it by multiplying each start-X and end-X with the factor (2 or 4, 3 looks very ugly).
- Reconstruct the lines into a new image canvas.
As a 1 pixel width item will have the same start-X and end-X value, it will retain the 1 pixel width. And things that have different start-X and end-X values, will get streched as if normal...
edit: Then, you need to rotate the image 90 degrees, and do it again to strech it in the Y axis.
However, what you want is the inset function in inkscape, not a perl program, as your source is a bad quality jpg, instead of a pixel perfect png.... (so dithered pixels get in the way of the above mentioned algorithm... it gets confused)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.