pfscut(1)

πŸ’– pfscut(1) β€” it's giving "crop, but make it iconic" πŸ’–

okay bestie, so this is pfscut from the General Commands Manual (section 1, the cool section), and it's literally the rectangle-extraction girlie of the PFS world. pull up a chair. πŸŽ€


✨ NAME ✨

pfscut β€” extract a rectangle out of a frame in PFS stream πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

pfscut [--left <columns>] [--right <columns>] [--top <rows>] [--bottom
<rows>] [--width <new_width>] [--height <new_height>] [--help] [x_ul
y_ul x_br y_br]

🌸 DESCRIPTION 🌸

so what this does is, it extracts a rectangle out of each frame in a PFS stream. every single one. no cap. 🫢

and you've got two whole ways to tell it which rectangle you want, bestie:

  • you can hand over the x and y coordinates of the upper left corner and the lower right corner, or
  • you can give it a little combo of the options listed down below ✨

lowkey important detail: the coordinates start with 0 and they rise in the left-to-right direction and in the up-to-bottom direction. so 0 is where it begins, not 1. periodt. πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • --left <columns>, -l <columns> β€” how many columns you're cutting off the left edge of the image. bye bye, left columns πŸ“
  • --right <columns>, -r <columns> β€” how many columns you're cutting off the right edge of the image. so long, right side πŸ’€
  • --top <rows>, -t <rows> β€” how many rows you're cutting off the top edge of the image. headless behaviour, but for crops ✨
  • --bottom <rows>, -b <rows> β€” how many rows you're cutting off the bottom edge of the image. floor's gone, bestie πŸ™ˆ
  • --width <new_width>, -W <new_width> β€” the width of the output image. and here's the tea: --width can be mixed with either --left or --right. pick a side, not both 😭
  • --height <new_height>, -H <new_height> β€” the height of the output image. same vibe: --height can be mixed with either --top or --bottom. one of them, bestie πŸ’œ
  • --help, -h β€” prints a list of the commandline options. your little cheat sheet 🌈

πŸŽ€ EXAMPLES πŸŽ€

okay these are the moments where it all comes together, iykyk:

pfsin image.hdr | pfscut --left 20 --top 5 | pfsout out.hdr

Cut out 20 columns from the left and 5 rows from the top edge of image.hdr, and save the frame as out.hdr. slay πŸ”₯

pfsin image.hdr | pfscut --left 20 --width 400 | pfsout out.hdr

Cut out 20 columns from the left edge of image.hdr, and create an output image 400 pixels in width. obsessed with the precision πŸ’…

pfsin image.hdr | pfscut 0 0 511 511 | pfsout out.hdr

Cut the left-upper part of the image of the size 512x512. and here's the note they left us, bestie, read it carefully: coordinates start with 0 and 512 is the last row/column that is included in the resulting image. that's why the corner is 511, not 512. the way that math works πŸ˜­πŸ‘‘


⭐ SEE ALSO ⭐

go give them a read too, they're the supporting cast and they ate πŸ’œ


πŸ’€ BUGS πŸ’€

found a bug or just have thoughts? please report bugs and comments to Dorota Zdrojewska <dzdrojewska@wi.ps.pl>. she's the main character of the bug tracker fr fr 🫢


okay that's the whole page, bestie! this one came straight out of the General Commands Manual, section 1, and it's signed off as pfscut(1) β€” so you know exactly which icon wrote it. go forth and crop, and remember: coordinates start at 0. πŸ§šπŸ’–βœ¨