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 450739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:53:56+00:00 2026-05-12T21:53:56+00:00

How would you develop something similar to what is described in this DabbleDB blog

  • 0

How would you develop something similar to what is described in this DabbleDB blog post?

  • 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-12T21:53:57+00:00Added an answer on May 12, 2026 at 9:53 pm

    Just answered a kinda related SO question yesterday. Some of the concepts there, along with the resulting test code (on git hub) could be a good start.

    As evolve mentions, scanning every pixel in an image (or even just the border) can be resource intensive. However, in this case (since you want to identify far more than just average color) it may be the way to go. Resizing the logo to a sane size would help reduce the server load, and shouldn’t really effect the output.

    Update: For these examples assume an image object has been created and $width and $height have been determined using imagesx(), getimagesize(), etc.

    Background Color

    The first thing we needed to do was figure out the logo’s background color. And that’s all the first version did, by using the corner pixels.

    Here use imagecolorat() to find the corner colors. Alternatively, use the average border color method from the referenced answer at the top.

    $color = imagecolorat($image, 0, 0); //do this for each corner
    $rgb = imagecolorsforindex($image, $color); //convert each color to a RGB array
    //average colors
    

    Saturation

    It turns out color theory has a way of measuring interestingness: saturation. So we pulled out an interesting color from the logo. Using the same color for the border and the text made things a bit more monotone than we wanted, so finally we decided to try and grab two interesting colors if they’re present.

    You can use the RGB to HSL functions at the imagecolorsforindex() manual page along with the pixel scanning code mentioned at the top to find color values with high saturation.

    Luminance

    We turned again to color theory and realized we could use the border color’s luminance to decide whether black or white text was more suitable.

    This SO thread lists different RGB to luminance calculations. I’m not certain what method is best (or technically correct) to convert 0-255 RGB images. But for what this is accomplishing (should the text be dark or light), I don’t think it’ll matter that much.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to develop a website with fully ajax navigation, but this means
I would like to develop in GWT a vertical menu similar to the one
I have been wondering how tiny url works. I would like to develop something
I'm writing this in the forlorn hope that someone has already done something similar.
I would like to develop a selection-tool for Screen which ignores the leading spaces
I would like to develop Mono application for Win/Linux/Mac in C# on Windows. Is
I would like to develop applications for the Windows platform & at the very
I would like to develop a MS paint like app for the iPhone. Could
I would like to develop administrative jython-scripts for WebSphere 7. Is there any IDE
I would like to develop an Android application which will have a local database.

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.