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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:34:48+00:00 2026-05-25T20:34:48+00:00

I took the average of each color by this method and wrote the average

  • 0

I took the average of each color by this method and wrote the average of red, green and blue to database.

Here are the images sorted by “-blue”. As you can see the 5th image has the most blue. Am I doing something wrong, or is it not possible to get average color from the histogram?

This is the handler where I create the histogram:

class ImageSave(webapp.RequestHandler):
    def post(self):
        homepage = HomePage()
        original_image = self.request.get("img")
        url = self.request.get("url")
        firm_name = self.request.get("firm_name")

        original_image = db.Blob(original_image)
        thumbnail = images.resize(original_image, 250, 250)
        img = images.Image(thumbnail)
        hist = img.histogram()
        rgb_weighed_average = hist_weighed_average(hist)

        #update database
        homepage.original_image = original_image            
        homepage.thumbnail = thumbnail
        homepage.firm_name = firm_name
        homepage.url = url

        homepage.red = rgb_weighed_average[0]
        homepage.green = rgb_weighed_average[1]
        homepage.blue = rgb_weighed_average[2]

        homepage.put()

        self.redirect("/imageupload")

Thanks!

  • 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-25T20:34:49+00:00Added an answer on May 25, 2026 at 8:34 pm

    Actually, the fifth image doesn’t have the most blue. Note that white is (255, 255, 255) as rgb, so an image that is completely white has just as much blue as an image that is completely blue. A darker blue has a smaller blue component than white.

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

Sidebar

Related Questions

I took a look at some questions here at stack overflow like this &
I want to make a query to list cats that took longer than average
I took 2 images with a cross point and now I'm trying to compare
I took a look at this answer and it goes in part to solving
I took some code here: Check if role consists of particular user in DB?
Took me a while to find this bug in my code. Trying to create
Took me a while to figure this out. So, I am answering my own
I am an average C/C++ programmer. Recently I took a project to make a
I took some code from some questions here in SO as well as some
It took me FOREVER to finally find code that can download a doc file

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.