Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:50:55+00:00 2026-05-22T14:50:55+00:00

I’m attempting to write a solution so that my user’s can watermark their Images

  • 0

I’m attempting to write a solution so that my user’s can “watermark” their Images with their Company Logo. I’ve got the actual watermarking part done and working so now I’m creating the “upload logo” feature so that they can provide me with the Logo they wish to appear watermarked onto their Images.

I’m using VB.NET and this will probably end up in a Web Service that accepts the Logo JPG file, and returns the “altered” Logo. What I need to happen in this Web Service is:

1) Gray-scale the image. Which I have working as well, thanks to this article.

2) Make the background transparent (so the logo looks clean when watermarked onto an image). This is where I’m stuck.

I think for the most part, any logos that are uploaded will have a generic white background but I can’t assume that. Is there a way to somehow detect the background of an image or the background colors, so that I may make those colors transparent?

I’ve downloaded and ran this project from code.google.com, called Transpoint, which is pretty much what I need except I won’t be able to have this as a stand-alone app. Also, I think this is written in Python which is foreign to me.

So basically what I need is just a way to determine the background on an Image (if that’s even possible?) or even just the background colors so that I may make them transparent. Any help/advice/suggestions would be greatly appreciated!

Thanks,
Lloyd

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:50:56+00:00Added an answer on May 22, 2026 at 2:50 pm

    @MusiGenesis (and anyone else who may be interested) here is what I did to (kind of) solve my problem. I basically followed the first half of your idea. I’ve created a function that will accept a bitmap, check each pixel against the first pixel at (0,0) – using a threshold of 10 for each RGB color. For each color within that threshold, the pixel is made transparent. Here is my code, which seems to work alright for the few images I’ve tried it with:

    Private Function TransparifyBackground(ByVal bmp As Bitmap) As Bitmap
    
            Dim temp As Color
    
            Dim background As Color = bmp.GetPixel(0, 0) 'top left will be assumed background color
    
            For y As Integer = 0 To bmp.Height - 1
                For x As Integer = 0 To bmp.Width - 1
    
                    'get the pixel for this position:
                    temp = bmp.GetPixel(x, y)
    
                    If ColorsMatch(background, temp) Then
    
                        'Make the Alpha value 50 for each pixel, leaving the other colors
                        Dim newColor As New Color
                        newColor = Color.Transparent
    
                        bmp.SetPixel(x, y, newColor)
    
                    End If
    
                Next
            Next
    
            Return bmp
    
        End Function
    
        Private Function ColorsMatch(ByVal background As Color, ByVal temp As Color) As Boolean
    
            Dim nThreshold As Integer = 10
    
            Dim temp_R As Integer = CInt(temp.R)
            Dim temp_G As Integer = CInt(temp.G)
            Dim temp_B As Integer = CInt(temp.B)
    
            Dim R As Integer = CInt(background.R)
            Dim G As Integer = CInt(background.G)
            Dim B As Integer = CInt(background.B)
    
            'check the difference of each value against our threshold:
            If ((temp_R - R) < nThreshold) AndAlso ((temp_G - G) < nThreshold) AndAlso ((temp_B < B) < nThreshold) Then
                Return True
            Else
                Return False
            End If
    
        End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but
Does anyone know how can I replace this 2 symbol below from the string
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.