In 2011, Lunar Magic introduced a feature called "Convert and Paste Bitmap", which allows you to paste any image into the Map16 editor and have it converted into ExGFX files and Map16 tiles. It's actually an easter egg (and therefore undocumented), which explains why not many people know about it.
The reason it's not an official feature is that FuSoYa isn't satisfied with the output, presumably with the way it reduces colors. That means it's not the end-all solution to graphics ripping yet — but if you don't need to worry about color reduction and just want to turn an image into ExGFX and Map16, it's an immensely useful and time-saving feature.
This is something we all could benefit from knowing about, though the lack of documentation kind of makes it unlikely to even have heard about it. I've played around a bit, and I thought I'd share what I've found out — this tutorial won't cover each and every option, but it's enough to get you started ripping your own graphics in LM.
This tutorial assumes you're familiar with inserting ExGFX, and ideally, with making them as well.
1. Unlocking the feature
As mentioned, the "Convert and Paste Bitmap" feature is an easter egg for the time being, meaning it's hidden and won't be usable right away. There are two ways to unlock it:
Here's how to do the latter:
Make sure you haven't opened the Map16 editor yet (). If you have, restart Lunar Magic.
Now open the overworld editor () and bring up the "Change Events Passed" dialog (Overworld → Change Events Passed…). In the text box, enter
If you did it right, the status bar at the bottom of the overworld editor window will say
2. Prerequisites
The neat thing about the bitmap pasting feature is that Lunar Magic will optimize the 8x8 tiles and automatically create ExGFX files so you don't have to. The one thing you still have to do, though, is tell LM which ExGFX files to create and which slots to use.
If you haven't already, install LM's 4BPP hack by extracting and re-inserting all graphics ().
Next, enable Super GFX Bypass (). Now choose the ExGFX files you want to create and the slots to insert them. (It's best to choose ExGFX files that don't exist yet, since Lunar Magic will just create them then.) For this tutorial, we're using ExGFX
When you close the Super GFX Bypass dialog, you'll probably be warned of ExGFX files not existing. Ignore those warnings.
Now, the thing is: When ripping, Lunar Magic won't overwrite any tiles that already exist. That means that if you want to assign a non-existent ExGFX file to a slot that already contains graphics, you'll have to clear that one first.
In our case, that's the
If you've created a new, empty ExGFX file, you can put that in directly and won't need to use this workaround.
3. Ripping an image
Now that we're all set up, let's get to ripping an image.
Lunar Magic will reduce the color palette of an image to fit the SNES's palette, but it may not always do a good job at it. If you have an image that uses a large amount of different colors, you might want to first use another tool to reduce the palette — however, if your image already only uses a handful of different colors, you'll have very few problems on that front.
For this tutorial, we'll be using the snow background from Sutte Hakkun:
All you need to do to rip this image is to paste it into the Map16 editor. Open it in an image editing program (MS Paint will do), select it and copy it (Ctrl-C). Now head back to Lunar Magic, open the Map16 editor, and with that window active, press Ctrl-V. This will open the "Convert and Paste Bitmap" dialog:
The top two images show the original image (left) and the way it'll look when converted by Lunar Magic (right). Already this doesn't look terribly bad — though if we take a closer look at the trees and the gradient in the sky, some colors are still off. Let's see what we can do about that!
4. The "Bitmap Pasting Color Options" dialog
Clicking "Color Options" will bring up the "Bitmap Pasting Color Options" dialog. (You can also open it by clicking the button — yep, that is what it does.)
You can tamper with the options on the left to fine-tune the color reduction process. I don't know how exactly all of these work, but feel free to play with them and see if that gives better results.
We'll be focusing on the right side. There you can see the top half of the current level's palette, that is, all the colors available for foreground and background tiles.
Some colors in this view are crossed out or marked with a star, which is explained in the dialog: squares with an X on top mean this color won't be used for ripping; squares with a star on top means the color may be used for ripping, but not modified. Finally, a blank square indicates that the color can be used by Lunar Magic for ripping — and indeed, you can see it's already put its custom colors there.
The key is that you can change this configuration — you can tell Lunar Magic which colors to use and which to leave intact. Left-clicking on a color switches between "blank" and "X", right-clicking switches between "blank" and "star". You can click the small buttons next to a palette row to change all of its colors in bulk (to "blank", "X" and "star" respectively).
The slider on the bottom left controls how quickly Lunar Magic will resort to using a "starred" color (i.e. how picky it will be about the starred color being the same as the color it needs).
By default, Lunar Magic treats the pasted image as a background, which means it'll default to using palette rows 0 and 1 (minus the status bar colors, of course). This is fine with us, since we do want to insert the image as a background. If you want to rip a foreground image instead, it may or may not be wise to make LM use palettes 2 and 3 instead. The right half of the palette is especially expendable.
Back to our case: to improve the quality of the ripped image, let's free up some more colors for LM to use!
Looking back at the previous dialog ("Convert and Paste Bitmap"), you can see that the original image has 24 different colors, but LM only had 21 modifiable colors to work with, so its output is also reduced to 21 colors. (The numbers in parentheses are in decimal.) Depending on the image you're using this might not always be noticeable, but in this case, it kind of is. It seems that if you just gave LM three more colors to work with, it could use the image without having to reduce the colors — but in reality it might be more than that, since each 8x8 tile can only use one palette row. If you freed up just one color all the way down in palette 7, that would essentially be useless. Freeing up a color is only useful when all the other colors in an 8x8 tile are also in the same palette row. The more colors can be in a single row, the better.
That means you'll need to free up more than three colors - but luckily, there's plenty of space left.
(As an aside: in theory, it might be better to swap palette rows 4 and 7 with 0 and 1 respectively, so you can use the entirety of rows 4 and 7 without worrying about overwriting status bar colors, as explained in the "Making better use of palettes" diagram in this thread. Let's keep it simple here, though, and just add on to the default palette rows.)
Free up some of the right half of the palette by left-clicking on the colors.
Hit OK and you'll get the following result:
Still not perfect, looking at the gradient (you may be able to fix this by making more clever use of colors), but not too shabby! Let's go with this.
5. The "Bitmap Pasting Other Options" dialog
Clicking "Other Options" will bring up the "Bitmap Pasting Other Options" dialog:
Most options in here are self-explanatory and can probably be left unchanged. (If you don't want LM to automatically paste the image into the background, unheck the third box from the top.)
Take a closer look at the first text box, though ("Insert starting at 8x8 tile #"). Lunar Magic needs free 8x8 tiles to place the ripped image in, and this tells it where to start looking for free tiles. By default it starts at tile
Looking back at the previous dialog ("Convert and Paste Bitmap"), you can see that the ripped image needs 0x177 tiles, but LM only found 0x100 free tiles to use. (The original image had a whopping 0xB80, but that's because a lot of them were duplicates, which LM is smart enough to use the same tile for.) If you try and hit OK in that dialog, you'll get an error message saying not enough free tiles were found.
The reason why LM can't find more than 0x100 tiles is because it starts looking at 200, and thus overlooks the BG1 slot. Change that number to
If you want, you can also change on which Map16 page the tiles are inserted by editing the third option ("Insert starting at 16x16 tile #"). By default it's 4200 (the top of page 42), which is fine in this case.
6. Finishing the insertion
Hit OK in both open dialogs, and if everything went right, you should see the kind of magic that LM's done:
It's automatically filled your ExGFX files, made Map16 tiles, and even inserted them into the background editor! Now that's comfortable. Imagine the hassle of doing that with an external tool (that is, coyping and importing half a dozen files).
Now all you need to do is save your work. Make sure to save not only the level and the Map16 data ( in LM and the Map16 editor respectively), but also the ExGFX files! That's easily overlooked. To save the ExGFX, hit F9 in the 8x8 editor, click "Yes", then re-insert the ExGFX ().
In this particular case, you may also want to move the background image down a bit in the background editor ().
Let's have a look at the in-game result:
Pretty good, isn't it? Worth the effort in my opinion — and it's less effort than any other way, too.
...and that's about it for this tutorial. I really hope this helps spread the word about Lunar Magic's Bitmap Pasting feature. Do try it out for yourself! If you have additional information, found a mistake you want to point out, or want me to reword a part for the sake of clarity, please let me know.
The reason it's not an official feature is that FuSoYa isn't satisfied with the output, presumably with the way it reduces colors. That means it's not the end-all solution to graphics ripping yet — but if you don't need to worry about color reduction and just want to turn an image into ExGFX and Map16, it's an immensely useful and time-saving feature.
This is something we all could benefit from knowing about, though the lack of documentation kind of makes it unlikely to even have heard about it. I've played around a bit, and I thought I'd share what I've found out — this tutorial won't cover each and every option, but it's enough to get you started ripping your own graphics in LM.
This tutorial assumes you're familiar with inserting ExGFX, and ideally, with making them as well.
1. Unlocking the feature
As mentioned, the "Convert and Paste Bitmap" feature is an easter egg for the time being, meaning it's hidden and won't be usable right away. There are two ways to unlock it:
- Wait for December 25. The feature unlocks itself on Christmas Day. Changing your system clock works as well.
- Use a cheat code to unlock it whenever you want.
Here's how to do the latter:
Make sure you haven't opened the Map16 editor yet (). If you have, restart Lunar Magic.
Now open the overworld editor () and bring up the "Change Events Passed" dialog (Overworld → Change Events Passed…). In the text box, enter
Give me presents!
(case sensitive), then hit Esc.If you did it right, the status bar at the bottom of the overworld editor window will say
Oh, is it that time of year again already?
. (You made LM think it's Christmas Day, after all.) The bitmap pasting feature will now be unlocked — open the Map16 editor and verify that the previously grayed-out button is now clickable.2. Prerequisites
The neat thing about the bitmap pasting feature is that Lunar Magic will optimize the 8x8 tiles and automatically create ExGFX files so you don't have to. The one thing you still have to do, though, is tell LM which ExGFX files to create and which slots to use.
If you haven't already, install LM's 4BPP hack by extracting and re-inserting all graphics ().
Next, enable Super GFX Bypass (). Now choose the ExGFX files you want to create and the slots to insert them. (It's best to choose ExGFX files that don't exist yet, since Lunar Magic will just create them then.) For this tutorial, we're using ExGFX
FFF
in the BG3
slot, ExGFXFFE
in the BG2
slot, and ExGFXFFD
in the BG1
slot.When you close the Super GFX Bypass dialog, you'll probably be warned of ExGFX files not existing. Ignore those warnings.
Now, the thing is: When ripping, Lunar Magic won't overwrite any tiles that already exist. That means that if you want to assign a non-existent ExGFX file to a slot that already contains graphics, you'll have to clear that one first.
In our case, that's the
BG1
slot, where we want to insert ExGFXFFD
. We can't just put FFD
in there, because if the ExGFX file doesn't exist, the original graphics will be left in that slot, and Lunar Magic won't use it to put its own tiles there. To properly clear the slot, you can first put 7F
there, then reopen the dialog and change it to the file you actually want (FFD
in our case).If you've created a new, empty ExGFX file, you can put that in directly and won't need to use this workaround.
3. Ripping an image
Now that we're all set up, let's get to ripping an image.
Lunar Magic will reduce the color palette of an image to fit the SNES's palette, but it may not always do a good job at it. If you have an image that uses a large amount of different colors, you might want to first use another tool to reduce the palette — however, if your image already only uses a handful of different colors, you'll have very few problems on that front.
For this tutorial, we'll be using the snow background from Sutte Hakkun:
All you need to do to rip this image is to paste it into the Map16 editor. Open it in an image editing program (MS Paint will do), select it and copy it (Ctrl-C). Now head back to Lunar Magic, open the Map16 editor, and with that window active, press Ctrl-V. This will open the "Convert and Paste Bitmap" dialog:
The top two images show the original image (left) and the way it'll look when converted by Lunar Magic (right). Already this doesn't look terribly bad — though if we take a closer look at the trees and the gradient in the sky, some colors are still off. Let's see what we can do about that!
4. The "Bitmap Pasting Color Options" dialog
Clicking "Color Options" will bring up the "Bitmap Pasting Color Options" dialog. (You can also open it by clicking the button — yep, that is what it does.)
You can tamper with the options on the left to fine-tune the color reduction process. I don't know how exactly all of these work, but feel free to play with them and see if that gives better results.
We'll be focusing on the right side. There you can see the top half of the current level's palette, that is, all the colors available for foreground and background tiles.
Some colors in this view are crossed out or marked with a star, which is explained in the dialog: squares with an X on top mean this color won't be used for ripping; squares with a star on top means the color may be used for ripping, but not modified. Finally, a blank square indicates that the color can be used by Lunar Magic for ripping — and indeed, you can see it's already put its custom colors there.
The key is that you can change this configuration — you can tell Lunar Magic which colors to use and which to leave intact. Left-clicking on a color switches between "blank" and "X", right-clicking switches between "blank" and "star". You can click the small buttons next to a palette row to change all of its colors in bulk (to "blank", "X" and "star" respectively).
The slider on the bottom left controls how quickly Lunar Magic will resort to using a "starred" color (i.e. how picky it will be about the starred color being the same as the color it needs).
By default, Lunar Magic treats the pasted image as a background, which means it'll default to using palette rows 0 and 1 (minus the status bar colors, of course). This is fine with us, since we do want to insert the image as a background. If you want to rip a foreground image instead, it may or may not be wise to make LM use palettes 2 and 3 instead. The right half of the palette is especially expendable.
Back to our case: to improve the quality of the ripped image, let's free up some more colors for LM to use!
Looking back at the previous dialog ("Convert and Paste Bitmap"), you can see that the original image has 24 different colors, but LM only had 21 modifiable colors to work with, so its output is also reduced to 21 colors. (The numbers in parentheses are in decimal.) Depending on the image you're using this might not always be noticeable, but in this case, it kind of is. It seems that if you just gave LM three more colors to work with, it could use the image without having to reduce the colors — but in reality it might be more than that, since each 8x8 tile can only use one palette row. If you freed up just one color all the way down in palette 7, that would essentially be useless. Freeing up a color is only useful when all the other colors in an 8x8 tile are also in the same palette row. The more colors can be in a single row, the better.
That means you'll need to free up more than three colors - but luckily, there's plenty of space left.
(As an aside: in theory, it might be better to swap palette rows 4 and 7 with 0 and 1 respectively, so you can use the entirety of rows 4 and 7 without worrying about overwriting status bar colors, as explained in the "Making better use of palettes" diagram in this thread. Let's keep it simple here, though, and just add on to the default palette rows.)
Free up some of the right half of the palette by left-clicking on the colors.
Hit OK and you'll get the following result:
Still not perfect, looking at the gradient (you may be able to fix this by making more clever use of colors), but not too shabby! Let's go with this.
5. The "Bitmap Pasting Other Options" dialog
Clicking "Other Options" will bring up the "Bitmap Pasting Other Options" dialog:
Most options in here are self-explanatory and can probably be left unchanged. (If you don't want LM to automatically paste the image into the background, unheck the third box from the top.)
Take a closer look at the first text box, though ("Insert starting at 8x8 tile #"). Lunar Magic needs free 8x8 tiles to place the ripped image in, and this tells it where to start looking for free tiles. By default it starts at tile
200
, which is the BG2
slot.Looking back at the previous dialog ("Convert and Paste Bitmap"), you can see that the ripped image needs 0x177 tiles, but LM only found 0x100 free tiles to use. (The original image had a whopping 0xB80, but that's because a lot of them were duplicates, which LM is smart enough to use the same tile for.) If you try and hit OK in that dialog, you'll get an error message saying not enough free tiles were found.
The reason why LM can't find more than 0x100 tiles is because it starts looking at 200, and thus overlooks the BG1 slot. Change that number to
100
, and it'll take that slot into account. (If it still doesn't, make sure the BG1 slot is in fact empty [].)If you want, you can also change on which Map16 page the tiles are inserted by editing the third option ("Insert starting at 16x16 tile #"). By default it's 4200 (the top of page 42), which is fine in this case.
6. Finishing the insertion
Hit OK in both open dialogs, and if everything went right, you should see the kind of magic that LM's done:
It's automatically filled your ExGFX files, made Map16 tiles, and even inserted them into the background editor! Now that's comfortable. Imagine the hassle of doing that with an external tool (that is, coyping and importing half a dozen files).
Now all you need to do is save your work. Make sure to save not only the level and the Map16 data ( in LM and the Map16 editor respectively), but also the ExGFX files! That's easily overlooked. To save the ExGFX, hit F9 in the 8x8 editor, click "Yes", then re-insert the ExGFX ().
In this particular case, you may also want to move the background image down a bit in the background editor ().
Let's have a look at the in-game result:
Pretty good, isn't it? Worth the effort in my opinion — and it's less effort than any other way, too.
...and that's about it for this tutorial. I really hope this helps spread the word about Lunar Magic's Bitmap Pasting feature. Do try it out for yourself! If you have additional information, found a mistake you want to point out, or want me to reword a part for the sake of clarity, please let me know.