Remove logo appear in right side upper corner
mkdir -p /tmp/workspace/logo-removal && curl -s -o /tmp/workspace/logo-removal/original.png "https://d361swluvexzqs.cloudfront.net/chats-attachments/file_00000000f654820886ddce4adc506f5b-1784651121685-fx600v.png" && python3 -c " from PIL import Image img = Image.open('/tmp/workspace/logo-removal/original.png') print('Size:', img.size, 'Mode:', img.mode) "
python3 -c " from PIL import Image, ImageDraw import numpy as np img = Image.open('/tmp/workspace/logo-removal/original.png') w, h = img.size print('Image size:', w, h) # The logo appears at roughly x: 850-980, y: 10-120 on a 1000x1000 normalized scale # On 1024x1536: x: ~870-1010, y: ~15-185 # Let's look at the actual pixel area to find the logo region arr = np.array(img) # Sample some pixels around the upper right corner to understand the area # Logo region approximately: x from 840 to 1024, y from 0 to 180 print('Top-right region sample pixels:') print('Pixel at (950, 30):', arr[30, 950]) # y, x print('Pixel at (990, 50):', arr[50, 990]) print('Pixel at (1000, 100):', arr[100, 1000]) print('Pixel at (980, 80):', arr[80, 980]) # Check background color around the logo area print('Background at (5, 840):', arr[5, 840]) # should be white print('Background at (5, 900):', arr[5, 900]) print('Background at (180, 950):', arr[180, 950]) "
python3 -c " from PIL import Image import numpy as np img = Image.open('/tmp/workspace/logo-removal/original.png') arr = np.array(img) # Crop the upper right corner to see the exact logo area # Logo is in upper right - let's crop from x=820 to end, y=0 to 200 region = img.crop((820, 0, 1024, 200)) region.save('/tmp/workspace/logo-removal/logo_region.png') print('Logo region saved') print('Region size:', region.size) "
python3 -c " from PIL import Image, ImageDraw import numpy as np img = Image.open('/tmp/workspace/logo-removal/original.png') arr = np.array(img) w, h = img.size # Sample background color in area near logo to match exactly # The background around the logo is very light (off-white / near white) # Let's sample from left of logo area and above to get the exact background bg_samples = [] for y in range(5, 20): for x in range(830, 860): bg_samples.append(arr[y, x].tolist()) bg_avg = [int(sum(c[i] for c in bg_samples)/len(bg_samples)) for i in range(3)] print('Background color avg:', bg_avg) # Also check what ESTD 1992 text region looks like print('ESTD region sample (y=160, x=870):', arr[160, 870]) print('ESTD region sample (y=170, x=900):', arr[170, 900]) # Define the logo bounding box (x1, y1, x2, y2) # Logo circle appears to be at approx x:855-1010, y:5-155 # ESTD. 1992 text is just below: y~155-175 # We'll cover x:850-1024, y:0-185 with background color logo_x1, logo_y1, logo_x2, logo_y2 = 850, 0, 1024, 185 # Get the background color to fill with fill_color = tuple(bg_avg) print('Fill color:', fill_color) draw = ImageDraw.Draw(img) draw.rectangle([logo_x1, logo_y1, logo_x2, logo_y2], fill=fill_color) img.save('/tmp/workspace/logo-removal/result.png') print('Saved result.png') "
python3 -c " from PIL import Image img = Image.open('/tmp/workspace/logo-removal/result.png') print('Output size:', img.size) import os print('File size:', os.path.getsize('/tmp/workspace/logo-removal/result.png'), 'bytes') "
result
Image · PNG
rgb(251, 251, 253)) sampled from the surrounding region, so the removal blends in cleanly with the rest of the poster.