Photobooth Plugin

4 Likes

If only the plugin can be bought with robux :frowning:
anyway, you never fail to make the most mind blowing things on roblox
keep up!

3 Likes

Unfortunately this is out of my control.

Roblox’s position on this has been that by enforcing USD they can maximize the revenue share of the creator. However, in my opinion it’s a bit more nuanced than that.

Let’s say for example that Roblox offered the ability to price in both Robux and USD and let the buyer choose which payment option they wanted. Anyone willing to do the math will quickly come to the conclusion that for the creator to get the same earnings from a sale the Robux cost will be substantially more than directly purchasing for USD.

For example, selling a something to earn 9.99 in robux:

-- current devex rate is 30,000 for $105.00 USD
((robux_cost * 0.7) / 30000) * 105 = 9.99
robux_cost = (30000 * 9.99) / 73.5 ~ 4000 robux

If we look how much it would cost to buy 4000 robux it’d be $49.99 USD which is comically overpriced compared to just buying it outright at $9.99.

Now of course I don’t want to rip off buyers, but if Roblox gave me the option to price in both robux and usd it would sure feel like I am.

I obviously don’t know the full details of why Roblox chose a usd only policy, but it wouldn’t suprise me to hear that this pricing imbalance is a reason for it. Robux buyers would likely notice this trend and feel like second-class citizens. This would lead to them directing their ire at either the creator or Roblox so they may have landed on the current policy to avoid that debacle entirely.

1 Like

first plugin i’ve bought. gotta say, it’s worth it!

4 Likes

all good i already bought it!
gotta say that this is the coolest plugin i’ve ever used.

1 Like

This was genuinely the best $10 I have spent!

I have been messing around with Photobooth for the past few days and I’m genuinely impressed. This has speed up the process of rendering items out by a LOT. This is a game changer and a life saver. With Future lighting existing I can confidently say goodbye to the days of rendering items out in blender.

One of the best features about this plugin is the ability to automate rendering. Alongside the black magic you do to calculate transparency, automation just makes this plugin perfect. The only limitation which I encountered is the fact that you can’t export multiple images at the same time to PNG format. This is most likely on Roblox’s end and out of your control.

This method does work but you have to export each capture one at a time. Regardless it worked out well in the end, since for my use case I would have had to do image processing after exporting from Roblox anyways. So I just sent the image data via localhost to VSCode and compiled the data back into a PNG with the image processed. (If you plan to do any image processing and are coding in Node.js I recommend using the “jimp” npm image processing library.)

When processing the images I applied a more aggressive alpha bleed algorithm to fix some aliasing issues. I honestly didn’t think there was any alpha bleed at first, but after looking at the patch notes I noticed there was one implemented in version 0.2.0?

image

Please keep in mind that this is an extreme worst case example. Where the image itself is dark on top of a dark background .I understand the decision to minimize the amount of alpha being bleed, as alpha bleed does take up a bit of processing time. In my case the images were downscaled from 1024x1024 to 256x256 and even then it still took a few seconds to process the alpha bleeding. As an alternative for those who are bothered by aliasing you can use this amazing site made by @XAXA to process the alpha bleeding.

TLDR: Really amazing tool 10/10 would recommend. It is genuinely a game changer especially for those who need background transparency and automation. Thank you for all your hard work!

1 Like

Glad you like it!

It’s funny you mention this as I had similar tooling in my repository, but it requires a bit more setup so it’s not something I included out of the box. I’d like to provide a sample workflow repository for this built w/ lune, but I noticed the net.serve function seemingly just dies. Maybe whenever that gets fixed or as you say Roblox provides another alternative altogether.

The alpha bleed algorithm I use is the same as what’s listed here. I’m going to delve into it a bit more though to make sure it’s doing the job right b/c I agree that based on your images it doesn’t quite look right.


Edit:

I looked into the alpha bleeding more and it seems to be working in unreleased v0.3.0. I haven’t changed the algorithm other than it’s now written in parallel so I assume it should be working in v0.2.2

Here’s the same 500x500 tree capture scaled to 1000x1000. On the right is the unbled image and on the left is the bled one:

I can see a noticable difference here and it seems like the alpha bleeding is working for me.

If you’d be willing to share a reproduction of a capture where you’re getting unbled (or badly bled) results via DM I can take a look and try and get this sorted.

1 Like

I didn’t know lune even existed, it looks like an amazing tool. I used node.js since I already did something similar for a different project. Compared to Node.js, lune might be much easier to use considering its in lua. When I tried exporting multiple images and it didn’t export them as PNG I was so confused. Since the funny thing is Roblox exports multiple images for materials when exporting a model. I genuinely expected them to export without issue. But, I still enjoyed the little coding adventure in image manipulation.

Regarding the alpha bleeding I don’t mind sending the place file I just had to remove assets that I unfortunately can’t share. I did some of my own testing and it doesn’t matter if its captured normally, via emulator, or via code the issue persists. Perhaps it’s my lighting settings? Not sure. I exported these by using Export Selection.

image

I tried it using a black sphere so its easier to see the aliasing. Running it through the alpha bleed website makes the issue completely disappears. It’s really dark I know, but trust me the sphere is there in workspace haha. If you move the camera, you can copy the code in ServerScriptService to reorient the camera back.


Capture.rbxl (49.7 KB)

One thing to note is that I haven’t uploaded these images to Roblox and I’m using XAXA’s Local File Importer. I have a lot of experience using this plugin and I really doubt it will be at fault. Especially considering the fact that the images that were ran through alpha bleed didn’t have any issues when imported through that plugin.

I cannot seem to reproduce this issue on my end.

If I turn off alpha bleeding in the code then I get similar results, but even then it’s not as egregious as what you’ve posted:


I removed the checkerbox background for a pure black instead + scaled the window down so bilinear interpolation would occur

I’m wondering if something else is going on here. Can you confirm what your resolution + OS scale value is listed as in the settings?

Also can you post an exported png unmodified. I’ll open it up and see what’s going on in the fully transparent pixels.

I doubt the issue is w/ your lighting or something similar. Otherwise XAXA’s code would be having the same issue.

1 Like

Yeah I always make sure its correct. I have the OS scale value set to (1, 1), and on windows I always use 100% scaling and my native resolution.

I sent one in the original message but it did look like it bugged out. All the examples I used above were unmodified. Hopefully it goes through:

1 Like

Okay some interesting findings. I did some analysis on your image. The alpha bleeding is working as far as I can tell. I turned the circle itself green and made every transparent pixel fully opaque. You can see the bleed pixels on the edge which are black.

Similarily when I load this image into studio and scale it up/down I do not see any issues.

I have two more questions for you and if I don’t get any leads from these then idk where to even approach this :woozy_face:

  1. For this image you posted. What were the exact steps you took start to finish to create this? The place file you linked only has on sphere in it so I assume you took the result of that single capture and used some image editing software to create this?
    image

  2. Here’s the same image bled 2 pixels as opposed to one. I wonder if for some reason you’re sampling more than just the direct neighbors and I have some misunderstanding of how bilinear filtering works. Let me know if this image causes the outlines for you.

1 Like

The image I posted used raw images produced by the plugin. I did not use any image editing software. The reason the sizes are all wonky is cause I used a 100x100 ImageLabel and I didn’t bother making the captures perfectly square.

As for replication I just clicked Photobooth > Viewport and clicked the capture button. After the capture was created and parented to StarterGui, I selected it and did Export Selection. Then I just imported it into Roblox using XAXA’s Local File Importer and put it into a ImageLabel.

2 pixels did the trick! I made the background a bit brighter so you can make out the other sphere. I guess its best to apply 2-3 pixels of bleed? The difference is even visible in the Local File Importer plugin too.

image

Really not sure what the root cause could be? Perhaps its hardware related, like Nvidia Control Panel shenanigans. I did try it on a laptop and it had the same results. Granted it also has an Nvidia GPU just a different generation. But the 2 pixel bleed does the trick, for me at least.

A bit unrelated, not sure if you already added or have plans to add this. But being able to select the background when previewing the capture might be nice. Similar to how XAXA allows you do in the Local File Importer plugin.

image

Aha! Using the local file importer by XAXA is getting the issue to occur for me! This is great since I can now start working on a fix. This more or less confirms the issue is not GPU related.

As for the background switching I do agree that’s a useful feature and I’ll get to work on adding it!

Thanks so much for all the back and forth. This was super helpful!

Edit: I now see what’s happening here. I can’t make the 1 pixel bleed assumption when the image is downscaled. The sample pixels could be anywhere on the image. Not sure how I’ll make this work in parallel if even possible, but I at least have my root cause! Thanks again!

2 Likes

Alright this should be fixed now!

The alpha bleed is not as fast as I’d like but I can’t think of how to make it much faster than I have already. Once parallel luau is allowed in plugins it’ll get slightly faster, but not much. As a result I added a new option in the settings to disable alpha bleeding. This works better for workflows such as yours where you’re exporting the images and bleeding them externally.

Speaking of which you mentioned that exporting one image at a time is slow, but it’s def possible to do multiple at once by grouping them all as a model. I added a “how to” for this in the OP + a lot of other documentation.

Also, you can now right click on an image when in the gallery to switch the background.

Finally, mentioning this here as well since a number of people were interested in it. You can now exceed the 1024x1024 limit by using the “Full Viewport Capture” mode. Again, more details on this in the main post.

Happy capturing!

2 Likes

Hey, I love the plugin!

Quick suggestion—could you add a toggle button for “Full Viewport Capture” It’d be super handy!

I’ve found personally the best place to put the actions is on the quick access toolbar. However, I’ll look into alternatives as this may be non-optimal for some.

1 Like

This…this is amazing! After I read this announcement, I checked the plugins bar but didn’t find the new option, but I read the first post and set up the action shortcuts. It took at least a minute to finish (plus I trimmed the image using Photoshop then lowered its size using Squoosh), but when I checked the exported PNG’s size, seeing something above 1024×1024 was cool! I wish the DevForum didn’t downscale large images (since I tried to make it take up less server space), but this File Explorer screenshot says it all:
A selected PNG image file in Windows 11 File Explorer with its size, name, and resolution written under it. Item type: PNG Image, Dimensions: 2821 x 4235, Size: 955 KB
Although it was scaled down, here’s my capture of my spring model (that I never finished texturing):


Also, I tested its UI capturing, which took a nice “screenshot” of my classic Windows-esque design with translucent pixels (its border)! (If you’re trying to do this but the plugin button’s disabled, select a GUI element like a frame first.)
PMM Computer UI Style Capture

Well, the missing feature was implemented, and seems to work beautifully, so I’ll keep my promise; Photobooth is a perfect plugin, and I can still recommend it for those needing high resolution renders of models in Roblox’s somewhat unique-looking 3D renderer.

1 Like

Is it possible to add alpha bleeding setting to the Bindings functions? It would be nice to be able to hard code it similar to how you can with captureType. Since as of right now you need to constantly turn it off because it doesn’t save after you restart studio.

Thanks!

There are a few options here that I’m aware of, but having it work like it does now was a purposeful choice.

I have two concerns with having the setting save:

  1. If a user toggles it off and forgets they may get a worse experience. I’d rather an unknowing person use alpha bleeding than not as it results in the “more correct” output.
  2. Not every setting will save so from a UX perspective it’s weird that only the alpha bleeding checkbox saves between studio sessions.

Similarly I have concerns with adding it to the bindings. If I do that it opens the door to adding more things in the future and I don’t want the bindings module to blow up in complexity.

I’m not against giving control via code over this, but I almost want it to be a hidden feature. Something you actually look for, not something you stumble across.

In short, I have to think about this more.

1 Like

This has improved my workflow tremendously! Thank you so much for making this.

I believe it could benefit from collapsing the settings and ribbon buttons into a single panel dock for the following reasons:

  • The plugin currently uses 3 ribbon buttons and frankly I do not have the real estate to justify it.
    – Plugin panel could have settings to bring back the dedicated buttons
    – Some of the features currently only work with quick access hotkeys. I don’t have much hotkey real estate, and quick access is like 6 pixels on my 4k monitor.
  • You mention “not all settings saving” UX issue- this also can be fixed with a panel.
    – You can add two tabs, one labeled ‘Capture’ and one labeled ‘Settings’ and this will contextualize which settings are saved in a plugin context and which are session capture options.
    – Instead of settings being a confirmation modal, add a Save button with a toast upon click.
  • Using a panel allows you to add a gallery view by default, showing multiple recent snapshots. Clicking could select them in workspace.

Additional photo related features that could be nice but are further from the initial scope of the plugin:

  • Saving and loading camera positions would be massively helpful as it enables further workflows:
    – You can export ‘shadow passes’ by taking two identically positioned photos where one is empty and the other has a shadow catcher.
    – You can design a thumbnail or icon, then go and modify your scene or character pose without losing your initial framing.
  • Any kind of lighting saving/loading. Lighting is a huge part of taking photos. There are not really any good plugins that are made to save and load lighting properties let alone light instances.
    – One of the biggest issues is that you cannot see lighting instance ranges while simultaneously moving their parent object. No plugin currently solves this.
  • Selection functionality similar to the ‘Model Scope’ plugin
    – Once enabled, if the user hits capture with one or more workspace instances selected the plugin would deparent the entire unselected workspace contents to a folder directly in the game datamodel.
    – This allows people to take captures of objects within an otherwise very complex scene without deconstruction their scene or creating new place files and recreating lighting.
    – Select the hero object, any lighting objects that influence it, and then click capture!

This plugin saves me enough hassle I’m more than happy to contribute to some of the ideas I’ve suggested if that makes implementation easier.

Sidenote- if you’re looking for alpha bleed implementation inspiration this js script has been used in the community for years https://github.com/Corecii/Transparent-Pixel-Fix

1 Like