Python Forum
remove all color but red, then replace it with black
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
remove all color but red, then replace it with black
#11
(Dec-27-2021, 07:59 AM)kucingkembar Wrote: I edit it and the code is working as I intended
Excellent!
(Dec-27-2021, 07:59 AM)kucingkembar Wrote: sorry out of topic, how did you attach pictures? can you upload directly from your PC?
When you are posting, click or tap onPreview Postthen scroll down until you seeAttachments. UseBrowseto find the image, open it, and then useAdd Attachment.
kucingkembar likes this post

Attached Files

Thumbnail(s)
   
Reply
#12
thank you again BashBedlam
[attachment=1498]
Reply
#13
(Dec-27-2021, 03:16 PM)BashBedlam Wrote:
(Dec-27-2021, 07:59 AM)kucingkembar Wrote: I edit it and the code is working as I intended
Excellent!
(Dec-27-2021, 07:59 AM)kucingkembar Wrote: sorry out of topic, how did you attach pictures? can you upload directly from your PC?
When you are posting, click or tap onPreview Postthen scroll down until you seeAttachments. UseBrowseto find the image, open it, and then useAdd Attachment.

hey, I see you give me a reputation point, thank you,
any tutorial so i can give you a reputation point too?
Reply
#14
If you click on the name in blue next to the avatar/logo it will take you to my profile. Scroll down to reputation and click rate. Thank you.
kucingkembar likes this post
Reply
#15
The problem working with color is there is no such thing as red or blue or green. Is red a color with rgb == 255, 0, 0? For most images there won't be any pixels with that rgb value. How low can the red portion be before you start calling this black. Is 100, 0, 0 "red enough". How much additional brightness can there be and still call a color red? Is 255, 100, 100 too pink?

When looking for particular colors does it make more sense to use HSV color encoding? In the HSV color model red has a Hue of 0, green 120 and blue 240 with 360 being red again. Saturation is how saturated the color appears, 1 (or 100%) being all color and 0 being no color. Value is how bright or dark the color appears with 1 (or 100%) being very bright and 0 being black. The HSV equivalent of 255, 0, 0 is 0, 1, 1 (Hue = 0 degrees, Saturation = 1 or 100%, Value = 1 or 100%).

But even though HSV makes it easier to specify redness using hue (0 +/-10 degrees say), you still need to make rather arbitrary selections for saturation and value.
kucingkembar likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why it gives me a black image and libpng warning: iCCP rickyw2777 1 468 Feb-16-2025, 08:26 PM
Last Post: rickyw2777
  Bright Black Screen Issue in Tkinter GUI Application rommy 2 1,036 Nov-29-2024, 10:50 PM
Last Post: woooee
  Black jack game simulation RoxaneParis1 3 1,347 Sep-11-2024, 06:57 AM
Last Post: indel635kanojia
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 3,418 Oct-25-2023, 09:09 AM
Last Post: codelab
  Checkbuttons always come up as black boxes regardless of the state kenwatts275 5 6,883 Jul-07-2020, 08:00 PM
Last Post: kenwatts275
  How to use nb-black python cde formatter ErnestTBass 3 8,629 Jun-04-2020, 03:51 PM
Last Post: ErnestTBass
  Finance: Black Scholes Model not working pwt 5 5,475 May-27-2020, 10:14 AM
Last Post: buran
  Because the emoji appears black and white at the exit ? nerd 3 6,720 Jan-28-2019, 11:34 PM
Last Post: nerd
  How to remove whitespace from a string when .replace and .strip do not work winnetrie 7 5,954 Jan-05-2019, 08:44 AM
Last Post: DeaD_EyE
  Search & Replace - Newlines Added After Replace dj99 3 4,334 Jul-22-2018, 01:42 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020