[ 🏛️ new / 🏖️ lounge / 🧻 ] [ 🔎 / 🔑 ] [ 🏠 Home ]

/new/ - New

news, history and politics
Name
Option
Subject
Comment
Flag
File
YouTube
Password (For file deletion.)


 No.11288

>be me
>watching an andrew wilson stream
>He's just watching libshits talk about policy
>libshits saying typical libshit nonsense
>Go on /pol/
>surely /pol/ likes andrew, they're anti gay like andrew, anti zionist like andrew
>turns out /pol/ fucking hates andrew.
>Since I just watched a stream of libshits I have some of their talking points in recent memory
>/pol/ is literally saying all the same fucking talking points that the libshits on the stream I was just watching were saying

Holy shit. I get it now. /pol/ is retarded. It's full of idealistic losers with no concept of the real world. They want conservative influencers to get up on mic and shout "KILL ALL NIGGERS KILL ALL JEWS". Like as if that's a good plan to slowly but surely move people back to the right.

Do not ever find yourself thinking that /pol/ is smart.

 No.11289

>conservative influencers are evil
>muslims are poor victims
>trannies make good fuck-toys
>If you ever think about LGBT in any capacity then you're obsessed.
>botted and mainstream

anything I'm missing?

 No.11290

>>11289
>anything I'm missing?

Trump is bad!

 No.11291

For anyone that doesn't get it. Conservative influencers serve an important role for right-wingers. They fight for freedom of speech and they fight to move the overton window. You know? The fucking thing that would let right-wingers have power again?

How stupid is the average right-winger to not see the symbiotic relationship between them and conservative influencers?

 No.11293

File: 1777421773515.png 129.12 KB, 800x1000, jpeg-vs-png.png

>>11288
photos are supposed to be jpegs not pngs numbnuts

 No.11294

>>11293
damn. Too late now. Ive been doing a cropped screenshot technique for 1000's of photos now.

 No.11295

>>11294
nothing that a python script can't fix

install python (x64 installer):
https://www.python.org/downloads/windows/

install PIL/pillow image library in cmd:
pip install pillow


copy and save the below text file to C:\scripts\compress_images.py,
and run this script in cmd with
py C:\scripts\compress_images.py


import os
import shutil
from PIL import Image

def has_transparency(img):
	"""Return True if the image has an alpha channel or transparent palette."""
	if img.mode == 'RGBA':
		return True
	if img.mode == 'P' and 'transparency' in img.info:
		return True
	if img.mode in ('LA', 'PA'):
		return True
	return False

def main():
	print("""
================================================================
                     PNG Compressor & Image Copier
================================================================

This script will:
  - Ask you for a folder path containing images
  - Create an 'output' subfolder inside that folder
  - Leave all your original images untouched
  - For PNG files:
       * If the PNG has transparency (alpha) -> copy original PNG to output
       * Else convert PNG to JPG
       * If the resulting JPG is LARGER than the original PNG,
         delete the JPG and copy the original PNG instead
  - For JPG, JPEG, GIF, WEBP files:
       * Copy them unchanged to the output folder
       * (If a JPG shares a name with a PNG, the JPG is skipped
         because the PNG will produce a JPG or copy itself)

Purpose: Safely compress PNGs that are better as JPGs, while
         preserving transparent images and never increasing file size.

================================================================
""")

	# Ask for directory
	while True:
		root_dir = input("Paste (right-click) directory path containing images (or enter q to exit): ").strip()
		if not root_dir:
			print("No directory entered. Exiting.")
			return
		# Check for exit command
		if root_dir.lower() == 'q':
			print("Exiting.")
			return
		# Remove surrounding quotes if present
		if root_dir.startswith('"') and root_dir.endswith('"'):
			root_dir = root_dir[1:-1]
		if os.path.isdir(root_dir):
			break
		print(f"Directory not found: {root_dir}")
		print("Please try again.")

	output_dir = os.path.join(root_dir, "output")
	os.makedirs(output_dir, exist_ok=True)

	# Get all files
	all_files = [f for f in os.listdir(root_dir) if os.path.isfile(os.path.join(root_dir, f))]

	# Separate PNGs and other images
	png_files = []
	other_images = []
	for f in all_files:
		lower = f.lower()
		if lower.endswith('.png'):
			png_files.append(f)
		elif lower.endswith(('.jpg', '.jpeg', '.gif', '.webp')):
			other_images.append(f)

	# Copy non-PNG images first (but skip JPG/JPEG if a PNG with same base name exists)
	for img in other_images:
		base = os.path.splitext(img)[0].lower()
		ext = os.path.splitext(img)[1].lower()
		if ext in ('.jpg', '.jpeg'):
			if any(os.path.splitext(p)[0].lower() == base for p in png_files):
				print(f"Skipping copy of {img} (PNG with same name will produce JPG)")
				continue
		src_path = os.path.join(root_dir, img)
		dst_path = os.path.join(output_dir, img)
		shutil.copy2(src_path, dst_path)
		print(f"Copied unchanged: {img}")

	# Now process PNG files
	if not png_files:
		print("No PNG files found.")
		return

	for png_file in png_files:
		png_path = os.path.join(root_dir, png_file)
		base_name = os.path.splitext(png_file)[0]
		jpg_path = os.path.join(output_dir, base_name + ".jpg")

		try:
			with Image.open(png_path) as img:
				if has_transparency(img):
					print(f"Alpha detected: {png_file} -> copying PNG")
					shutil.copy2(png_path, os.path.join(output_dir, png_file))
					continue

				rgb_img = img.convert('RGB')
				rgb_img.save(jpg_path, 'JPEG', quality=80, optimize=True)

				png_size = os.path.getsize(png_path)
				jpg_size = os.path.getsize(jpg_path)

				if jpg_size > png_size:
					print(f"JPG larger ({jpg_size} > {png_size}) for {png_file} -> reverting to PNG")
					os.remove(jpg_path)
					shutil.copy2(png_path, os.path.join(output_dir, png_file))
				else:
					print(f"Converted {png_file} (JPG: {jpg_size}, PNG: {png_size})")

		except Exception as e:
			print(f"Error processing {png_file}: {e} -> copying original PNG")
			shutil.copy2(png_path, os.path.join(output_dir, png_file))

	print("\nDone! Check the 'output' folder for results.")

if __name__ == '__main__':
	main()



[Return] [Catalog] [Top][Post a Reply]
Delete Post [ ]