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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:56:26+00:00 2026-05-30T07:56:26+00:00

I have an issue with imagecopyresampled for buffers that use alpha values. apparently the

  • 0

I have an issue with imagecopyresampled for buffers that use alpha values. apparently the algorithm premultiplies the pixels alpha values before filtering, this results in black borders arround objects.

Steps to reproduce:

  • take an image that is completely white in the RGB part and that has a (antialiased!!) white circle (go with a circle, not with a square!) on black background in the Alpha part (so the alpha part will have mostly totally white and totally black pixels, as well as some gradient pixels on the borders of the circle due to antialiasing – this means the input image is NOT premultiplied – it is straight/unmatted, because the RGB part of the image is completely white).

  • scaledown the image by half using imagecopyresampled

  • compose the result over a completely white image

What i’d expect:
completely white image

What i get:
a grayish border arround the outline of the circle

I’m pretty sure this is due to premultiplied alpha within the scaledown algorithm (the algorithm multiplies the pixels alpha value with it’s rgb value to calculate the new rgb value – thus white pixels will become gray)

Does anyone know a workarround for this?

  • 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-30T07:56:27+00:00Added an answer on May 30, 2026 at 7:56 am

    I would suggest to try image magick for php.

    http://www.php.net/manual/en/imagick.resizeimage.php

    http://www.php.net/manual/en/imagick.scaleimage.php

    in my experience all hassles concerning imaging in php just go away.

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

Sidebar

Related Questions

I have this issue that I want to resolve. Lets think we have this
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue that is driving me a bit nuts: Using a UserProfileManager
I have an issue with watin test that should browse for pdf and upload
Have another issue here. Our app starts out with a tab activity. But, before
I have an issue that, while using sql server 2005 i have executed update
i have issue regarding Paging using filterexpression. here's the piece of code for filtering
i have done drag and drop using with jquery. here i have issue that
I have this issue when debugging mobile apps on the emulator. When I press
I have issue with a value that should have just work, however, it seem

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.