How can I take a look at my framebuffers? - debugging

As the title says, how can I verify if my framebuffers got rendered properly?
Is the best way to use glReadPixels and save the content to an image? If so, is there a simple open source library for doing this?

You can use gDebugger, it's best for the task. Allows to see buffers, textures, calls, states and lots of other useful information.

Related

Processing – What is the fastest way to generate an animated .gif-file out of Processing 2?

i am not shure, if there are many Processing-people inside Stackoverflow, anyway:
What is the fastest way to generate an animated .gif-file out of Processing 2?
Thanks in advance!
You've got a couple of options:
Use the gifAnimation library
Save an image sequence from Processing, then encode a gif with an external tool (like ImageMagick,GIMP, Photoshop, etc.)
Also check out this answer for more details
George's answer is correct if you want to do this programatically, and it's what you should do if you care about gif quality.
Another quick and dirty alternative is to capture your screen directly.
I use a tool called ScreenToGif. You can record your sketch directly, without any exporting or encoding on your end.
Here is another question with a bunch of similar tools.

find similar image in library to photo

I work at a printer where we generate thumbnails of artwork for orders and store them in a folder before printing.
I'm looking for a code library that will allow us to take a photo of a printed item and look through the library of thumbnails for the design.
Just wondered if anyone knows of a library or api that could do this?
Thanks
David
pHash is one solution.
There are others but that mainly depends on your requirements: do you only want to identify identical images, if not, what types of transformations do you want to be able to capture etc.
In general you should look for near duplicate image search.
#david-jennings there are numerous methods to look for similar images in libraries. Remember that google already does this in google images.
Your problem falls under the scope of Content Based Image Retrieval (CBIR), which aims at looking for images with similarities in their content. MPEG-7 is a standard established many years ago to address these issues and the research field is very active with new techniques being developed constantly.
The main idea in CBIR is to extract some kind of a signature from an image and try to match it with all previously extracted signatures of all images in your database. Which method to use depends upon the specifics of your problem... According to your initial post I suppose that probably the use of SHIFT is going to do the work for you...
You may implement such a system using OpenCV with C/C++/Java/etc., or something more "scientific" using MATLAB.

What is the difference between ImageMagick and libGD?

I don't know anything about either library but I have to choose one of them.
Which one whould you recommend?
I'm using Perl. I need to generate images for weather site. The image is generated for a location and should contain temperature and a weather condition image inside. I guess this is a piece of cake for both libs. But I want to know which one is more powerful. I've read that libGD is not able to rotate text. Maybe there are some other drawbacks? Which one generates images faster? Whose API is easier to use?
according to this source, you should use GD:
GD and other modules built on top of that (like GD::Graph) are more aimed at producing "new" images like charts.
And you can read "Develop your own weather maps and alerts with Perl and GD", which is what you're looking for.
If you some some time. try them both, play a little, and decide.
I find both to be straightforward to use ImageMagick gives you a lot more power than gd. Here are two Magick examples from my posts:
How can I use IO::Scalar with Image::Magick::Read()
How can I resize an image to fit area with Image::Magick?
to give you examples of the API.
I have used GD to create a visualization.
See Script : giss-timeline-graphs.pl on that page.
imagemagick is more robust, however libGD should be able to cover most of the image generation tasks as well. you should see perl API/functions to both of these libraries to see what is more convenient for you.

Creating nice pdfs with ruby

I would like to create pdfs with ruby. One special need is embedding a picture into text (or a textblock), which means I need to be able to let the text flow around the image. E.g. the image should be in the rigth upper corner and the text should start left of the image and continue after the image by using the whole width of the page. How can I do this in ruby? Thank you for any suggestions!
In the past to get print quality PDFs in Ruby, I used rtex.
It's fast too, which is a real bonus.
Prawn to the rescue?
I like the html -> pdf approach. Although it is probably not the best option (prawn is) it makes it easy to design the pdf. See this website. You could also go for the approach documented at jimneath.org.
Good luck
iText is the heavyweight that will allow you to do anything you want with PDFs you can bridge to it with jRuby.
Another option I used was driving open office (it has a ui less option which you can automate from Ruby)
How about having Ruby generate some LaTeX code, then use pdflatex to produce the PDF?
Although I haven't done it myself I've seen people use a headless Open Office. You can control it from Ruby and use it to generate PDF files. You can even use an Open Office template and just fill in some elements into it.

How would you generate default user profile pictures?

I've been admiring StackOverflow's default quilt-like profile pictures (which I notice are also on the Fail Blog) and am curious what program both are using to generate them.
But what I really want to know is: If you were to design the system to create default profile pictures, how would you do it?
I'm looking for ideas on what algorithm you'd use, as well as things like how you would related the image to the user, be it related to their username, or some portrayal of their progress (ie the image gets more complex, or larger, as they gain reputation).
FWIW, the default pictures are generated by gravatar, which is why you'll see them on more than this site.
It's called an Identicon. On Stackoverflow it Gravatar uses your IP address to generate the image.
This is an editorial, not necessarily an answer.
Those auto-generated avatars on this site come from a service (Gravatar) that focuses exclusively on providing avatars and is therefore the core of their business. For apps that aren't specifically intended to generate and display avatars, I would just go with an empty placeholder (like Facebook). It's a neat feature, but is it worth your development time when a simple placeholder would be just as effective?
A very good source of images would be flame fractals. They are rather computationally expensive, so simply sourcing them from a project like electric sheep or having them be rendered by the user's computer should be considered to offload the work.
Who wouldn't want default profile pictures like these?
alt text http://sheepserver.net/v2d6/gen/202/124809/icon.jpg alt text http://sheepserver.net/v2d6/gen/202/124805/icon.jpg alt text http://sheepserver.net/v2d6/gen/202/125373/i77.jpg alt text http://sheepserver.net/v2d6/gen/202/125431/i116.jpg
Use a Julia set or something like that and set the initial conditions to a hash of the user's email address.
I'd use a jpeg server tool (aspjpg or similar) to manipulate the image on load so it displays their badges within their profile pic.
In fact, using any tool to dynamically generate images is pretty cool. Applying some sort of 3d or flash technology to dynamically create images using random variables for eye spacing or facial structure would be pretty wicked as well.
But ya this is a weird question. hah!
I did something similar years back, I used POV-Ray to generate little 3D scenes with torusses (torii ?) and spheres. There were lots of parameters to tweak such as the position, size and colour of each object.
POV-Ray is a scriptable 3D render engine, you can find it here.
Unfortunately my images all looked too similar to each other. I love Gravatar's identicons as uses on this site. I think the symmetry helps and the shapes are unique enough that you can identify users fairly clearly.
In ruby there have a library http://github.com/swdyh/quilt to generate it!

Resources