gimp

Using .c/.h images exported with gimp in SDL

给你一囗甜甜゛ 提交于 2019-12-10 23:24:58
问题 I wonder if someone has any idea if it's possible to use .c or .h images with SDL exported in gimp. I know there is .xpm but I can't somehow enable transparency for .xpm images. I do know there are some complex ways to render .c/.h files in C, but I'd rather use SDL, since I'm trying to learn it. Thanks in advance! 回答1: gimp header export function use it's own format, providing a macro used to uncrunch it, more details here you can load raw data buffer into a sdl surface using SDL

Loading an image from a C source file, exported from GIMP

拥有回忆 提交于 2019-12-10 20:15:52
问题 I'm trying to load an openGL texture for a game. The texture is an image that has been exported as a .C source file from GIMP. When I #include this file in my project (using Visual C++ 2010 Ultimate), I get a compiler error saying fatal error C1091: compiler limit: string exceeds 65535 bytes in length Is there any workaround ? The reason I wanted to export the image as a C header file was so that the program compiles with the image, and I dont have to provide raw image files along with the

What is the difference between let and let* in Scheme?

纵饮孤独 提交于 2019-12-10 16:13:23
问题 I am writting a script for GIMP and using let* as it was in a sample I took. But it seems to be just a lambda sugar exactly like let . Why are they different? What is the difference between them? 回答1: They are different in the order in which variables are bound. Consider this for example: > (let ((a 1)(b (+ a 2))) b) This code will FAIL because b requires a , which has not been defined before. It is defined, in the same let , but Scheme will take all your let definitions as only one statement

Python: invert image with transparent background (PIL, Gimp,…)

狂风中的少年 提交于 2019-12-10 13:44:19
问题 I have a set of white icons on transparent background, and I'd like to invert them all to be black on transparent background. Have tried with PIL (ImageChops) but it does not seem to work with transparent backgrounds. I've also tried Gimp's Python interface, but no luck there, either. Any idea how inverting is best achieved in Python? 回答1: ImageChops.invert seems to also invert the alpha channel of each pixel. This should do the job: import Image img = Image.open('image.png').convert('RGBA')

Loading image onto MenuItem is losing transparency on pre-multiplied alpha image

这一生的挚爱 提交于 2019-12-10 12:17:37
问题 I am really in need of some help here. I am trying to load an image which I believe to be 32bpp with pre-multiplied alpha onto a MenuItem (I followed this guide to make the image in GIMP). I am aware of the ContextMenuStrip class and do not want to use it. The following is the code I am using to set the image onto the MenuItem: // apis [DllImport("user32.dll", SetLastError = true)] static extern bool SetMenuItemInfo(IntPtr hMenu, uint uItem, bool fByPosition, [In] ref MENUITEMINFO lpmii);

python-fu select copy paste

∥☆過路亽.° 提交于 2019-12-10 10:56:55
问题 I'm a newbie in python-fu, (my second day), so my question may seem naive: I'd like to select a rectangular portion from "r400r.png", rotate it 90 degrees, and save my selection in "r400ra.png". So far, I tried something on these lines: for fv in range(400,401): fn='r%sr.png' % fv img=pdb.gimp_file_load('/path/'+fn,fn) drw=pdb.gimp_image_get_active_layer(img) img1=pdb.gimp_image_new(1024,1568,0) lyr=pdb.gimp_layer_new(img1,1024,1568,0,'ly1',0,0) pdb.gimp_rect_select(img,10,200,1422,1024,2,0,0

Inkscape - Not fully converting png into svg

試著忘記壹切 提交于 2019-12-10 10:22:10
问题 I opened one PNG file in Inkscape and exported it as SVG. When I opened that file with notepad I came to know that the PNG file is embedded within it. If the conversion happened then the resulting file should have only SVG related tags. It shouldn't embed the image within it. Or Am I doing anything wrong. Note: Save as option also producing the same kind of file. I am using Inkscape version 0.48 in Windows 7 - 64 bit. 回答1: A .png file is a raster image file. In order to convert it to a vector

Gimp: python script not showing in menu

醉酒当歌 提交于 2019-12-10 02:39:14
问题 I followed this tutorial and this is what I have come up so far: #!/usr/bin/python # -*- coding: utf-8 -*- #http://www.ibm.com/developerworks/library/os-autogimp/ from gimpfu import* def plugin_main(timg, tdrawable, maxh=540, maxw=800): currentWidth = tdrawable.width currentHeight = tdrawable.height newWidth = currentWidth newHeight = currentHeight if (maxw < newWidth): newWidth = maxw newHeight = (float(currentHeight) / (float(currentWidth) / newWidth)) if (maxh < newHeight): newHeight =

Save as on multiple files at once (GIMP)

我是研究僧i 提交于 2019-12-09 19:25:48
问题 I have a series of .xcf images which I want to save as .png . I can open each file and save as .png but since there are a lot of images it would take a fair amount of time. Is there a way to convert all images at once, or another way I have to spent less time on this job? Thank you in advance. 回答1: I'd use the Python console inside GIMP for that - if you happen to be in Windows, take a look on how to install the Python extension for GIMP 2.6 (on Linux it either comes isntalled or is a matter

Calculate colour temperature in K

假如想象 提交于 2019-12-09 02:27:58
问题 I have written a lib for working with colours and stuck trying to calculate Tc(k) . From what I have read working in the CIE 1931 XYZ colour space is the way to go and it can be obtained using xyY . So far I have got everything correct to the point of figuring out the correct x and y from : X Y x = ____________ y = ____________ ( X + Y + Z) ( X + Y + Z) The numbers much up to the chart, but cant find anything that details how you go from x and y to Tc(K) eg: For #FF0000 I get the following. x