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
   
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
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 1,040 Oct-25-2023, 09:09 AM
Last Post: codelab
  Checkbuttons always come up as black boxes regardless of the state kenwatts275 5 4,735 Jul-07-2020, 08:00 PM
Last Post: kenwatts275
  How to use nb-black python cde formatter ErnestTBass 3 6,847 Jun-04-2020, 03:51 PM
Last Post: ErnestTBass
  Finance: Black Scholes Model not working pwt 5 3,939 May-27-2020, 10:14 AM
Last Post: buran
  after using openpyxl to add colors to script, black shows up white online in excel Soundtechscott 1 3,697 Jun-08-2019, 10:33 PM
Last Post: Soundtechscott
  Because the emoji appears black and white at the exit ? nerd 3 5,623 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 4,482 Jan-05-2019, 08:44 AM
Last Post: DeaD_EyE
  Search & Replace - Newlines Added After Replace dj99 3 3,414 Jul-22-2018, 01:42 PM
Last Post: buran
  Need to replace (remove) Unicode characters in text ineuw 1 8,606 Jan-02-2018, 08:01 PM
Last Post: micseydel
  Replace only '-' values with NaN, don't remove minus sign for negative numbers. rajpython 2 6,066 Sep-10-2017, 01:23 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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