Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Looking for coders
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Looking for coders

yokowasisyokowasis Member
edited March 2019 in General

I need something like this:
1. Upload image with a form
2. Remove the background of the image
3. Convert said images, into base64 transparent images
4. Save the string

How much am I looking for? I can probably do it, I just don't have time as of right now.

Feel free to pm me your offer

«1

Comments

  • yokowasis said: I can probably do it, I just don't have time

    Thanked by 1dedicados
  • cpsdcpsd Member

    Remove.bg does that with an API and for free with their website.

  • @cpsd said:
    Remove.bg does that with an API and for free with their website.

    Tried remove bg, unfortunately it works only for photos. I am looking to remove white/black / Grey whatever solid background color from a logo.

    It's because I need png file with transparent background, but people send me a jpg file with background instead.

  • yokowasis said: It's because I need png file with transparent background, but people send me a jpg file with background instead.

    Good luck with your borders with compression artifacts...

    By the way, if this is "one" image, as you stated, you can do it by hand, with any image processing software.

    Thanked by 1eol
  • edited March 2019

    delete

    Thanked by 1eol
  • deankdeank Member, Troll

    I've never erased my post ever since I got here. I may be a troll but I am confident of my posts.

    Erasing posts is like erasing your balls. Man up.

  • delete

    Thanked by 1eol
  • Matt Hardy ?

  • somehow I'm 100% sure his budget under $100

  • sibaper said: somehow I'm 100% sure his budget under $100

    Which'd be reasonable, depending on what language he wants it in as it'd be 100 lines of code or so.

    Apart from the artifact issue mentioned, the main issue is deciding what is the background colour. If it's simply white then that's easy to sort. Otherwise it's going to need a bit more thinking about identifying a background colour and swapping it with alpha.

  • What the hell is a base64 transparent image? Do you mean an alpha layer PNG that's then converted into base64?

  • Yes, this is what he meant, with the 4) about returning the string.

  • @SteveMC said:
    Yes, this is what he meant, with the 4) about returning the string.

    I see. It's going to be kind of annoying to differentiate the background when he pretty much wants to remove anything between #000000 and #FFFFFF. Lots of luck with that.

    Thanked by 1Janevski
  • SteveMCSteveMC Member
    edited March 2019

    if the background is a solid color, as suggested, the imagecolortransparent PHP function is easy, but:

    • with a JPEG image, even a solid color might contains artifacts (in fact, will contain artifacts),
    • if the "background" color also appears inside the logo, pixels will be made transparent too,
    • borders of the logo will show aliasing,
    • ...
  • Yep.

  • As for detecting a solid background color, this is not that hard, you take all the pixels of the first line, of the last line, of the first column, and last column, the color appearing the most often has "chances" to be the background color. (this is lazy method, not professional and accurate one :wink: )

    Thanked by 2Janevski eol
  • @SteveMC said:
    As for detecting a solid background color, this is not that hard, you take all the pixels of the first line, of the last line, of the first column, and last column, the color appearing the most often has "chances" to be the background color. (this is lazy method, not professional and accurate one :wink: )

    I think you've just talked yourself into a job.

  • I'm not sure if it's scientifically possible.

  • FalzoFalzo Member

    @SteveMC said:
    you take all the pixels of the first line, of the last line, of the first column, and last column, the color appearing the most often has "chances" to be the background color.

    unless the logo is bordered ;-)

    If that's for the hosted wordpress stuff anyways, the script should also consider the background for the page or menu it is to be placed on.
    removing the white background from an otherwise black logo and putting that on a black nav bar is most likely unwanted...

  • I don't really care about the programming language, it could be php, nodejs, or whatever. As long as it is web based.

    Perhaps an example is needed

    I want to convert this

    into this

  • @yokowasis said:
    I don't really care about the programming language, it could be php, nodejs, or whatever. As long as it is web based.

    Perhaps an example is needed

    I want to convert this

    into this

    Photoshop

  • yokowasisyokowasis Member
    edited March 2019

    @uxtvdl said:

    @yokowasis said:
    I don't really care about the programming language, it could be php, nodejs, or whatever. As long as it is web based.

    Perhaps an example is needed

    I want to convert this

    into this

    Photoshop

    What software do you think I use to remove the background?

    I want to automate the process, using web apps.

  • The fact that you have no fucking clue about how this works doesn't really help your cause. I don't dislike you; I wish you luck. This will probably end painfully.

    Thanked by 2uptime Janevski
  • PandyPandy Member

    @yokowasis said:
    I don't really care about the programming language, it could be php, nodejs, or whatever. As long as it is web based.

    Perhaps an example is needed

    1. Open photopea.com (just for example, there might be others)
    2. paste the image
    3. magic wand the white parts
    4. export as png
  • gnugnu Member

    This is impossible to automate. If you find a way, patent that and offer it to Adobe, they will pay you in gold bullions.

  • Will the images only be png?

  • You need to build a neural network for that purpose. It would take time and money. Unless your background are all white, good luck with your budget.

    Thanked by 1coreflux
  • If the images are decent sized and simple (logos) its not far fetched. All you need to do is get background color at the first pixel (top left) using imagecolorsforindex and convert to png if needed.

    Then as per the function from here

    function transparent_background($og, $output, $bg_color)
    {
        $img = imagecreatefrompng($og);
        $colors = explode(',', $bg_color);
        $remove = imagecolorallocate($img, $colors[0], $colors[1], $colors[2]);
        imagecolortransparent($img, $remove);
        imagepng($img, $_SERVER['DOCUMENT_ROOT'].'/'.$output);
    }
    transparent_background('in.png', 'out.png','255,255,255');//pure white background
    
    
    Thanked by 2coreflux ferri
This discussion has been closed.