[Mod] Image Loader [0.1.0] [imageloader]

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

[Mod] Image Loader [0.1.0] [imageloader]

by kaeza » Wed Jul 31, 2013 04:26

Image Loader Mod



This mod allows loading image files from Lua, allowing other mods to manipulate the images.

It also has a chat command to place such images into the world, reducing the colors to a given "palette" of nodes.

Links:
Download as .ZIP
Download as .tar.gz
Browse Code on Github

License:
The main interface is released under the WTFPL.
The BMP loader is a component of the Allegro library, and was ported from C by me. It is released under the Giftware License.
The test image is a conversion to BMP of the default MESE Pickaxe. License is CC-BY-SA.

Usage:
Place your images in the `<moddir>/images' directory, then use the `/loadimage <filename>' command to load it at your current position.

This mod currently only supports the following image formats:
  • Windows or OS/2 Bitmaps (.bmp). Note: only 24bit, uncompressed files are supported.
  • Portable Network Graphics (.png). Supposedly it should support every kind of PNG type that exists (truecolor, grayscale, interlaced, etc), as long as it is well-formed.

API Documentation will come later; for now, look at the source.

Screenshots:
Image
Image
Image
Last edited by kaeza on Wed Jul 31, 2013 04:32, edited 1 time in total.
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
 

User avatar
Chinchow
Member
 
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Wed Jul 31, 2013 05:22

This is really cool
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

User avatar
webdesigner97
Member
 
Posts: 1323
Joined: Mon Jul 30, 2012 19:16
Location: Bergisch Gladbach, Germany
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
 

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

by kaeza » Wed Jul 31, 2013 09:06

Image
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
 

User avatar
PenguinDad
Member
 
Posts: 122
Joined: Wed Apr 10, 2013 16:46
Location: Germany
GitHub: PenguinDad
IRC: PenguinDad GhostDoge
In-game: PenguinDad

by PenguinDad » Sat Aug 03, 2013 09:04

The idea is amazing but at the moment I don't use it because it has no PNG support.
<Cyndra> Programming properly in C++ feels like putting together a jigsaw puzzle
<Cyndra> where the peices don't fit and the picture doesn't matter.
 

mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Sep 30, 2013 17:28

Tip for those using gimp converting to bmp - when you export, check the 'Do not write color space information' box under Compatibility Options, otherwise loadimage will return an unknown file type error.

Bug spotted with the .zip version
Code: Select all
minetest.place_schematic(pos, schem, "0")
should be
Code: Select all
minetest.place_schematic(pos, schem) or minetest.place_schematic(pos, schem,0)


not bad for reproducing maps :)
Image

a 3d version of this mod would be cool too, take the brightness of colors to determine height :-)
Last edited by mauvebic on Mon Sep 30, 2013 18:13, edited 1 time in total.
 

davidforsure!!!
Member
 
Posts: 72
Joined: Fri Oct 25, 2013 09:02

by davidforsure!!! » Fri Oct 25, 2013 11:43

i change fix the (pos shem) but it didn't work i want this mod so bad man pppppllllssss +infinite
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03
 

Josh
Member
 
Posts: 1146
Joined: Fri Jun 29, 2012 23:11
Location: Victoria, Australia
 

User avatar
general3214
Member
 
Posts: 118
Joined: Fri Oct 04, 2013 03:15
Location: California, USA

by general3214 » Sat Oct 26, 2013 02:49


You're doing it wrong. This is correct way to do it: TROLOLOLOLOL
March 6, 2014, 8:37 PM PST: I will no longer continue my mods.
Mods | GitHub | MCF
Avatar made by Annahstas
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Fri Dec 20, 2013 08:23

I get
Code: Select all
ServerError: LuaError: error C:\Minetest\bin\...\mods\imageloader\imageloader.lua:118:attempt to call field 'place_scematic'(a nil value)
in 0.4.7 and it just crashes the game in 0.4.8
 

User avatar
RealBadAngel
Member
 
Posts: 556
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Fri Dec 20, 2013 08:55

wcwyes wrote:I get
Code: Select all
ServerError: LuaError: error C:\Minetest\bin\...\mods\imageloader\imageloader.lua:118:attempt to call field 'place_scematic'(a nil value)
in 0.4.7 and it just crashes the game in 0.4.8



https://github.com/kaeza/minetest-imageloader/blob/master/imageloader.lua#L118
You have "scematic" in your error log. Have you edited the mod?
 

User avatar
rubenwardy
Moderator
 
Posts: 5539
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Fri Dec 20, 2013 08:57

wcwyes wrote:I get
Code: Select all
ServerError: LuaError: error C:\Minetest\bin\...\mods\imageloader\imageloader.lua:118:attempt to call field 'place_scematic'(a nil value)
in 0.4.7 and it just crashes the game in 0.4.8


Are there any messages?

When it crashes, there may be messages in the console that does not go to debug.txt (If it crashes Minetest, rather than going to the error screen).

Try updating, as it looks like there is a typo in your version.
Last edited by rubenwardy on Fri Dec 20, 2013 08:58, edited 1 time in total.
 

ch98
Member
 
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Mon Jan 06, 2014 03:08

Can someone give me a simple explanation on how to use this to get r,g,b of a pixel on a bmp image? All i need is a function where i specify the x, y and the image file and it gives back rgb, and function to get the dimentions of the file. I don't know too much about these things so can you explain as much as possible?
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.
 

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

by kaeza » Mon Jan 06, 2014 03:27

ch98 wrote:Can someone give me a simple explanation on how to use this to get r,g,b of a pixel on a bmp image? All i need is a function where i specify the x, y and the image file and it gives back rgb, and function to get the dimentions of the file. I don't know too much about these things so can you explain as much as possible?

There are actually several bitmap file formats (not sure how much those are still used at the moment). This mod only supports some formats (Windows and OS/2 BMP files, and only of 24 bits color depth). The loader_bmp.lua file is quite straightforward; you should take a look at it and rip it apart for your needs (give due credit ;) ).

See also BMP file format article on Wikipedia.
Last edited by kaeza on Mon Jan 06, 2014 03:28, edited 1 time in total.
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
 

ch98
Member
 
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Mon Jan 20, 2014 21:36

kaeza wrote:There are actually several bitmap file formats (not sure how much those are still used at the moment). This mod only supports some formats (Windows and OS/2 BMP files, and only of 24 bits color depth). The loader_bmp.lua file is quite straightforward; you should take a look at it and rip it apart for your needs (give due credit ;) ).

See also BMP file format article on Wikipedia.

Thanks! I got this far, and started testing but image is way too big and computer is freezing up. I still do want this size. I made the image smaller but still is very big. Is there any way to load smaller part of the image so i wouldn't need supercomputer to run this mod? I do know it is the right format because it froze up. If it wasn't, it would just have put out error messages.

[edit] I try'd fixing the problem i got, but I have not tested yet.
Last edited by ch98 on Fri Jan 24, 2014 01:36, edited 1 time in total.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
Location: Slovakia
IRC: AMMOnym
In-game: AMMOnym

Re:

by AMMOnym » Sat Dec 06, 2014 14:34

mauvebic wrote:Tip for those using gimp converting to bmp - when you export, check the 'Do not write color space information' box under Compatibility Options, otherwise loadimage will return an unknown file type error.

Bug spotted with the .zip version
Code: Select all
minetest.place_schematic(pos, schem, "0")
should be
Code: Select all
minetest.place_schematic(pos, schem) or minetest.place_schematic(pos, schem,0)


not bad for reproducing maps :)
Image

a 3d version of this mod would be cool too, take the brightness of colors to determine height :-)

Hello, Is something like this possible to meke with this wow map too ? Image
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
Location: Slovakia
IRC: AMMOnym
In-game: AMMOnym

Re: [Mod] Image Loader [0.1.0] [imageloader]

by AMMOnym » Sat Dec 06, 2014 19:09

Code: Select all
20:07:22: ERROR[ServerThread]: ERROR: An unhandled exception occurred: basic_string::_S_construct null not valid


This error I get each time I use /loadimage mp.bmp
 

User avatar
Krock
Developer
 
Posts: 4141
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Image Loader [0.1.0] [imageloader]

by Krock » Sat Dec 06, 2014 19:54

AMMOnym wrote:
Code: Select all
20:07:22: ERROR[ServerThread]: ERROR: An unhandled exception occurred: basic_string::_S_construct null not valid


This error I get each time I use /loadimage mp.bmp


kaeza wrote:Currently, this mod only supports 24bit, uncompressed Windows or OS/2 .bmp files. Support for other formats will come later.

Are you sure, it's a 24bit bitmap?
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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

Re: [Mod] Image Loader [0.1.0] [imageloader]

by kaeza » Sat Dec 06, 2014 20:41

AMMOnym wrote:
Code: Select all
20:07:22: ERROR[ServerThread]: ERROR: An unhandled exception occurred: basic_string::_S_construct null not valid


This error I get each time I use /loadimage mp.bmp

Can you provide the stack traceback (should be after the error)? I am able to reproduce the crash, but my copy is crashing without printing the traceback.
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
 

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

Re: [Mod] Image Loader [0.1.0] [imageloader]

by kaeza » Sat Dec 06, 2014 20:43

Krock wrote:Are you sure, it's a 24bit bitmap?

It's an image that comes with the mod as a demo, and it is indeed the right format.
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
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
Location: Slovakia
IRC: AMMOnym
In-game: AMMOnym

Re: [Mod] Image Loader [0.1.0] [imageloader]

by AMMOnym » Sat Dec 06, 2014 21:19

I hope this helps
Attachments
IL.zip
(2.7 MiB) Downloaded 59 times
 

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

Re: [Mod] Image Loader [0.1.0] [imageloader]

by kaeza » Sun Dec 07, 2014 05:56

It seems to have been an issue in the engine itself. It has been fixed here, so you'll have to wait for 0.4.11 or ask somebody to provide a new development build for Windows.

Thank you for reporting anyway :)
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
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
Location: Slovakia
IRC: AMMOnym
In-game: AMMOnym

Re: [Mod] Image Loader [0.1.0] [imageloader]

by AMMOnym » Sun Dec 07, 2014 12:09

kaeza wrote:It seems to have been an issue in the engine itself. It has been fixed here, so you'll have to wait for 0.4.11 or ask somebody to provide a new development build for Windows.

Thank you for reporting anyway :)

This is bigger problem then you think. I can not use any new build. Each time I dig something is new builds, my game crash itself and if I want to try it again, I can not start the world. It is crashed in "media/item textures" loading. This is the newest build I can use.
Thanks anyways
 

User avatar
Krock
Developer
 
Posts: 4141
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Image Loader [0.1.0] [imageloader]

by Krock » Sun Dec 07, 2014 12:37

AMMOnym wrote:This is bigger problem then you think. I can not use any new build. Each time I dig something is new builds, my game crash itself and if I want to try it again, I can not start the world. It is crashed in "media/item textures" loading. This is the newest build I can use.
Thanks anyways


debug.txt with setting "debug_log_level = 3" in minetest.conf goes there:
viewforum.php?f=6
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Next

Return to WIP Mods



Who is online

Users browsing this forum: Google [Bot] and 3 guests