How to make a cube in Jimp? - discord.js

I am using Jimp and I would like to know if it is possible to make a cube like the one in the image.
Here's an image of what I want to have
I haven't tried anything because I don't know where to start.

Related

Apply 2 different textures to two sides of the same face of an object in Autodesk Maya

I've been trying to apply 2 separate textures to the inside and outside of a bowl shaped object in Maya. I don't want to extrude that particular face and put a different texture. That's easy though.
But since I'm working on a low-res model where I'm restricted to have a certain number of faces, so I need an alternative. Someone gave me an idea of using Maya Nodes. But, I couldn't come up with a solution.
How can I do this?
You can achieve that using samplerInfo node.
Just put a switch or colorBlend and use flippedNormal as a switcher between 2 textures/shaders/w/e is it.

Save RenderCopyEx

I want to create an image processing application with SDL.
My problem is that I want to rotate a surface. I tried to write the algorithm for accessing the pixels and putting them in the right position but I get really jaggy results.For this reason,I thought that the easiest solution would be to take advantage of the SLD_RenderCopyEx.
However, as I expected, this function doesn't affect the surface but the renderer, and if I want to save the result(after rotation) I will not get the rotated version of the image. Do you guys know if there is any way of saving the image as I see it on the screen? And if not, what do you guys suggest me to do ?
You can use SDL_RenderReadPixels() to read pixels from the current rendering target.

IconView and lots of Images GTK

I have question to GTK users, in my program I will need a lot of images and I wonder if I can somehow connect iconview with images? Because some of these images are going to be big and I want to show ther dwarfs in one window and full size in another. Or do I have to use table and then making small icons from images, place them inside table, save somewhere original dimensions and then just restore original dimensions in that another window where I want to have full dimensions of pictures?
Sorry for bothering and thanks in advance.
You have to first load the image manually (using gdk_pixbuf_new_from_file() or gdk_pixbuf_new_from_file_at_size()). Then manually create the different sizes you need (using gdk_pixbuf_scale() or gdk_pixbuf_scale_simple()). To add the images to the icon view you have to create a 'GtkListStore' (or any other object implementing the GtkTreeModel interface) and add your scaled down pixbuf to it. It would be a good idea to do this in a separate thread since it will probably take some time for the images to load and you don't want your application to lock up.

WPF Control that renders a 2d dimension?

I need to render the value of the width or height of a 2d geometry object and the request is for it to not just be text, but somewhat like a dimension that would be a set of building plans. Something like this image...oops too new to post images...like this image that I googled -
http://www.archidigm.com/lounge/archdim/centerline_dim_1.gif
I have looked for something like this, but haven't been lucky in my search. I am fine with creating it, but thought that I would try to not reinvent the wheel if possible. Anyone know of a control or library out there that renders something like this?
This article looks really helpful: http://msdn.microsoft.com/en-us/library/bb613591.aspx. Although it talks about optimizing drawing, it gives mention to a lot of different classes you can use.
Specifically, take a look at the Drawing class: http://msdn.microsoft.com/en-us/library/system.windows.media.drawing.aspx#snippetGroup1
If you want the shapes to be interactive (because it seems like you are building a CAD-like application), the DrawingGroup might help. Check out this example: http://msdn.microsoft.com/en-us/library/system.windows.media.drawinggroup.aspx#snippetGroup
Also, DrawingGroup might be a good way to group the actual shape (for example, a wall in a building) and the ruler object that shows the dimensions.

How can I implement a color search for an image gallery?

I'm working on a simple image gallery project and I'd like to implement the ability to search based on a color hex code. So if someone enters 'ff1212' into the search, it will display only those images that contain that particular shade of red. I've seen a website that has a search that works the way I want: http://cssline.com (the AJAX part is nice, but its the server-side stuff I'm after).
I can't figure out how to store the color data from each image. Should I get each unique hex code used in an image and store them as tags in a database? It seems like this would create a huge dataset which would slow down the search. What about storing the images themselves in the database and scanning their colors during the search? That also sounds like it would be slow. I know that once I figure out how to store the data for speedy searching I can figure out how to code the search itself.
Does anybody have any tips or advice that can help me?
First of all, bring the number of colors in the images down to an amount that is workable (max 16 or so).
Then, to be able to compare different images, i think it's a good idea to store only websafe values (the intervals #erelander was talking about) to normalize the results.
You may try storing color intervals of each image in a database rather than storing each unique color value. Of course, searching these intervals may require a different search algorithm.
I dont think that storing color values in database will make it slow. It will, although, make it insanely large! And given that you can index data on color values, the process will be fast.

Resources