fosslife / devtools-x

Collection of offline first developer utilities available as non-electron desktop application. all in one place, cross-platform, 10MB app!
https://devtools.fosslife.com/
MIT License
1.12k stars 54 forks source link

[Feature request] Image Background removal #93

Open ThijsZijdel opened 3 months ago

ThijsZijdel commented 3 months ago

For a quick background removal I mainly use this site. Easier than firing up photoshop each time.

I came across this rust repo that uses onnx, would it be viable to implement it? https://github.com/dnanhkhoa/rust-background-removal/tree/main

@Sparkenstein I would like to learn more about the rust part and are happy to collaborate on this feature. Note: I could implement the JS library myself, but see a major benefit in using the rust ported one

Screenshot 2024-08-10 at 11 09 47
Sparkenstein commented 3 months ago

This is a great feature. But the rust library you mentioned, uses the same models js library uses @imgly/background-removal. There's won't be any difference in performance. rust one starts a webserver on users machine, we can't do that.

plus it relies on downloading the models first. not a great idea in my opinion. Devtools-x guarantees to be offline first even today and it's a security risk to download anything on users computer on our behalf.

Feel free to explore any offline first library, if that increases the bundle size I am fine with that. we already have image-rs installed if that helps. but primary requirements are it shouldn't open any ports, download anything.

(If you want to download models, I would recommend creating a separate "background remover" tauri app. will be happy to contribute)

ThijsZijdel commented 3 months ago

plus it relies on downloading the models first. not a great idea in my opinion. Devtools-x guarantees to be offline first even today and it's a security risk to download anything on users computer on our behalf.

Ok fair points, what about the MonacoWrapper.tsx, could u take a look there. Since the themes should be available within the node_modules, just couldn't get it to work.

They are currently downloading from jsdelivr.

Feel free to explore any offline first library, if that increases the bundle size I am fine with that. we already have image-rs installed if that helps. but primary requirements are it shouldn't open any ports, download anything.

Will take a closer look at it next week. Should be possible with node.

(If you want to download models, I would recommend creating a separate "background remover" tauri app. will be happy to contribute)

And for sure, DevTools-Models