image library functions in lua api

For people working on the C++ code.
bobomb
Member
 
Posts: 101
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb

image library functions in lua api

by bobomb » Mon Mar 07, 2016 01:42

There are several mods which are forced to include various lua image libraries to varying degrees of success, such as my mod, realterrain, and it would make a world of difference if the image functions built-in to minetest core could be partly accessed by the modding API. in particular it would be nice to be able to read the value of a pixel or range of pixels from 8 and 16 bit grey and rgb files of all standard formats (tiff, png, bmp), preferably without loading the entire image into memory. It might also be nice to be able to change pixel values and write an image to file for certain mods, but for realterrain, imageloader, and other mods, pixel-access to standard image formats would change our world.
 

User avatar
kaeza
Moderator
 
Posts: 2157
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: image library functions in lua api

by kaeza » Mon Mar 07, 2016 21:21

Loading images for manipulating or reading pixel data is a task that is probably out of scope for the engine. There are maybe 2 or 3 mods that need it (not counting forks), and the possibilities are kinda limited, so adding support to the engine is overkill.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

celeron55
Administrator
 
Posts: 449
Joined: Tue Apr 19, 2011 10:10

Re: image library functions in lua api

by celeron55 » Sun Mar 13, 2016 20:52

Converting pixels to voxels is a valid use case that comes up now and then.

If somebody contributes a well-made small implementation of reading image files to the Lua API, I think it could be included. Anything that goes beyond the bare minimum will probably have hard time being accepted because Minetest isn't Gimp.
 

bobomb
Member
 
Posts: 101
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb
 

bobomb
Member
 
Posts: 101
Joined: Sat May 23, 2015 20:28
GitHub: bobombolo
IRC: bobomb
 


Return to Partly official engine development



Who is online

Users browsing this forum: No registered users and 1 guest