How to create a PNG image that is only a byte - png

We've seen PNG images on the web that are less than 1kb. When I create a new blank PNG in Photoshop, its size is about 20-30 Kb :(
For example, I've seen a 100*10 px PNG that was only 90 bytes!
Which Apps can generate these? Do you have any tips?
After fvu's answer: plz tell me what optimizer is better than other?

There no reason a minimal png should be that big. Check out png optimizers like this one or this online tool should Photoshop not include such a tool. Google knows about even more PNG optimizer tools.
Edit: a 10*100px png floodfilled with red measures 143 bytes optimized with Paintshop Pro's integrated PNG optimizer. Apparently it can be made even smaller than what Paintshop manages :-)
Edit based on OP's comment: Corel Paint Shop Pro is a photo editor, I guess you can call it a lightweight alternative to Photoshop. It was the quickest way for me to create a png comparabable to op's example.
As for what optimizer is best: some good old fashioned testing and comparing should tell you a lot, I wouldn't be surprised to see that the performance of individual optimizers depends on the input characteristics - eg some will do better on photos than others but on computer imagery it's the other way around, based on the algorithms used.
Aside from the compression ratio the ease with which you can integrate the optimizer in your workflow should be considered quite important.

Related

How to find out resolution and count of frames in YUV 4:2:2 file?

How can I determine the resolution and framecount in a YUV 4:2:2 file if I know how many pixels (luma samples) the image contains?
There is a tool to help you to guess the format, give you visual feedback while you trying different parameters.
I'd like to propose to use the excellent tool vooya http://www.offminor.de/
Free for linux usage. Quite cheep for windows.
Many options to specify a raw video format, with instant preview

Has facebook changed its image rendering logic recently?

Since the past few months, I've been noticing that they tend to some kind of pixelated image first which then gets replaced by a much better image.
Is this some kind of trick to reduce perceived latency by facebook?
Or is it Chrome doing it?
i think it's progressive image rendering. Quote from the linked blog
Images already render progressively in a web browser -- but you can do even better. Simply save your GIF or PNG images with the "interlaced" option, or your JPEG images with the "progressive" option.
This blog might answer your query - checkout following links -
Image Optimization Part 3: Four Steps to File Size Reduction
Image Optimization Part 4: Progressive JPEG…Hot or Not?

Make and edit .psd file in iPhone file system

I was wondering what the easiest way to make a .psd file from within an iPhone app. I am making an app just like the Layers app, and I can't fiure out how he makes and edits .psd files.
Writing a psd parser yourself is a futile business. See the super-famous quote from here (original source code)
// At this point, I'd like to take a moment to speak to you about the Adobe PSD format.
// PSD is not a good format. PSD is not even a bad format. Calling it such would be an
// insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having
// worked on this code for several weeks now, my hate for PSD has grown to a raging fire
// that burns with the fierce passion of a million suns.
It goes on and on. So, look for an (open-source) psd reading/writing library.
I'm the author of the Layers app the OP mentioned. Unfortunately, coneybeare is right - I pretty much wrote an objective-c implementation from scratch. The trick turned out to be basing it off a very old version of the PSD spec, from before it got insanely polluted with crap. Layers actually writes Photoshop 3 files.
UPDATE: I've published the PSDWriter from Layers on github. You can use it to write PSD files from a set of UIImages on iOS or Mac OS X: https://github.com/bengotow/PSDWriter
Enjoy!
Checkout ImageMagick. There's an iOS compiled binary that you can link into your application. Or if you want, you can set up the compilation business yourself.
They probably looked up the spec for the psd format, then figured out how to write it manually.

Take screenshot of audio stream

Alright, what I need is a command-line application that allows you to take a screenshot of a file's audio stream.
For example it should be run like this:
app.exe "C:/artist-title.mp3" "C:/mp3Stream.jpg"
app.exe "C:/artist-title.wav" "C:/wavStream.jpg"
It only has to be able to capture mp3 streams, other streams are a bonus.
Preferably all audio channels are listed in the image, but if all channels are combined into one mono stream it would work just as good for me.
So, is there such a application out there? So that I don't re-invent the wheel.
If not does anyone have tips on how I should go about writing such a application myself? Preferably in Java. I can handle programming pretty well but I'm not exactly an expert on the MP3/WAV formats.
Why do I need it...? Well, it's more fun to link to a file online with some sort of preview image besides the link. It gives you a hint of the audio character before you listen to it (is it loud? does it look like "bit music"? does it have any parts that are more quiet than others? etc).
Never mind, I wrote my own little application in Java.
It was a piece of cake once I found this excellent guide:
http://codeidol.com/java/swing/Audio/Build-an-Audio-Waveform-Display/
Although you can't download the source from that page (as far as I can tell, though he makes it apparent that you should be able to) he does provide some very useful key lines of code that makes it easy to puzzle together the application.
Adding a little bit of help (easy stuff). You can get a graphics object from doing so:
BufferedImage img = new BufferedImage(500, 100, BufferedImage.TYPE_INT_RGB);
Graphics2D gfx = (Graphics2D) img.getGraphics();
And once you have drawn everything you need on the gfx you can save it to disk just by one line:
ImageIO.write(img, "jpg", new File("waveform.png"));
It's hard to get it to look very good though. Doesn't look as nice as for example Audacity. Guess they have spent more time on it than a few hours though.
The biggest pain about this is however that Java don't support MP3 import. They really should get around to that.
So to get the waveform of MP3s I first convert them into WAV using "javazoom.jl.decoder.Decoder.java", it's on their website. Very easy to use, just give the input path and the output path and it's done.
javazoom dot net (couldn't post more than one "hyperlink" on this website)
The big downside of this is of course that a huuge WAV file has to be created, and woe be unto thee if the MP3 happens to be 15 minutes or so... The WAV will be over 100 MiB (maybe even 200 MiB, haven't found out since I got a Java-out-of-memory-error, even though I gave the VM 512mb).
MP3 support in Java today please. Guess the reason they don't have it is because of copyright issues. Copyright really is slowing man down.
Also take a look at http://www.jsresources.org/
It provides a pretty good FAQ section about everything Audio in Java, and some example applications.

rendering a waveform on an iphone

I was wondering if anyone has any suggestions on how to go about rendering a waveform of an audio file. I wold like to enable the user to set an in and out point of an audio track and I need to have a waveform so you can see where to put the points.
Are there any libraries available for this or does it need to be a completely custom solution?
Is it even called a waveform ? Maybe there's a better word for it so I can do some more searching.
TIA !
I'm reposting my answer from this question, since it applies here as well:
When displaying an audio waveform, you will want to do some sort of data reduction on the original data, because there is usually more data available in an audio file than pixels on the screen. Most audio editors build a separate file (called a peak file or overview file) which stores a subset of the audio data (usually the peaks and valleys of a waveform) for use at different zoom levels. Then as you zoom in past a certain point you start referencing the raw audio data itself.
Here are some good articles on this:
Waveform Display
As far as source code goes, I would recommend looking through the Audacity source code. Audacity's waveform display is pretty good and mostly likely does a similar sort of data reduction when rendering the waveforms.
CorePlot is the library you are looking for. It is hosted on Google code.
See this related SO question.
I realise this is an old post, however i searched for this recently, and decided to roll my own solution based on a few snippets i located on SO and a few other sites.
See my answer to This question