Package: anshitsu
AnshitsuA tiny digital photographic utility."Anshitsu" means a darkroom in Japanese.InstallRun this command in an environment where Python 3.10 or higher is installed.We have tested it on Windows, Mac, and Ubuntu on GitHub Actions, but we have not tested it on Macs with Apple Silicon, so please use it at your own risk on Macs with Apple Silicon.pipinstallanshitsuUsageIt is as described in the following help.INFO:Showinghelpwiththecommand'anshitsu -- --help'.

NAMEanshitsu-ProcessRunnnerforCommandLineInterface

SYNOPSISanshitsuPATH<flags>

DESCRIPTIONThisutilityconvertsthecolorsofimagessuchasphotos.Ifyouspecifyadirectorypath,itwillconverttheimagefilesinthespecifieddirectory.Ifyouspecifyafilepath,itwillconvertthespecifiedfile.Ifyouspecifyanoption,thespecifiedconversionwillbeperformed.TosakamodeisamodethatexpressesthepreferenceofTosaka-senpai,acharacterin"Kyūkyoku Chōjin R",for"photos taken with Tri-X that look like they wereburned onto No. 4 or No. 5 photographic paper".Onlyusefloating-pointnumberswhenusingthismode;numbersaround2.4willmakeitlookright.

POSITIONALARGUMENTSPATHType:strDirectoryorFilePath

FLAGS--colorautoadjust=COLORAUTOADJUSTType:boolDefault:FalseUsecolorautoadjustalgorithm.DefaultstoFalse.--colorstretch=COLORSTRETCHType:boolDefault:FalseUsecolorstretchalgorithm.DefaultstoFalse.--grayscale=GRAYSCALEType:boolDefault:FalseConverttograyscale.DefaultstoFalse.--invert=INVERTType:boolDefault:FalseInvertcolor.DefaultstoFalse.--tosaka=TOSAKAType:Optional[Optional]Default:NoneUseTosakamode.DefaultstoNone.--outputrgb=OUTPUTRGBType:boolDefault:FalseOutputsamonochromeimageinRGB.DefaultstoFalse.--noise=NOISEType:Optional[Optional]Default:NoneAddGaussiannoise.DefaultstoNone.

NOTESYoucanalsouseflagssyntaxforPOSITIONALARGUMENTSIf a directory is specified in the path, anoutdirectory will be created in the specified directory, and the converted JPEG and PNG images will be stored in PNG format.If you specify a JPEG or PNG image file as the path, anoutdirectory will be created in the directory where the image is stored, and the converted image will be stored in PNG format.Note:If you specify a file in any other format in the path, be aware there is no error handling. The program will terminate abnormally.AlgorithmsThe following algorithms are available in this tool.RGBA to RGB ConvertConverts an image that contains Alpha, such as RGBA, to image data that does not contain Alpha.
Transparent areas will be filled with white.This algorithm is performed on any image file.invertInverts the colors of an image using Pillow's built-in algorithm.In the case of negative film, color conversion that takes into account the film base color is not performed, but we plan to follow up with a feature to be developed in the future.colorautoajustWe will use the "automatic color equalization" algorithm described in the following paper to apply color correction.This process is more time consuming than the algorithm used in "colorstretch", but it can reproduce more natural colors.(References)A. Rizzi, C. Gatta and D. Marini, "A new algorithm for unsupervised global and local color correction.", Pattern Recognition Letters, vol. 24, no. 11, 2003.colorstretchThe "gray world" and "stretch" algorithms described in the following paper are combined to apply color correction.This process is faster than the algorithm used in "colorautoajust".(References)D. Nikitenko, M. Wirth and K. Trudel, "Applicability Of White-Balancing Algorithms to Restoring Faded Colour Slides: An Empirical Evaluation.", Journal of Multimedia, vol. 3, no. 5, 2008.grayscaleConvert a color image to grayscale using the algorithm described in the following article.Python でグレースケール(grayscale)化Note: This article is written in Japanese.Tosaka modeTosaka mode is a mode that expresses the preference of Tosaka-senpai, a character in "Kyūkyoku Chōjin R", for "photos taken with Tri-X that look like they were burned onto No. 4 or No. 5 photographic paper".Only use floating-point numbers when using this mode; numbers around 2.4 will make it look right.When this mode is specified, color images will also be converted to grayscale.outputrgbOutputs a monochrome image in RGB.noiseAdd Gaussian noise.To add noise, you need to specify a floating-point number; a value of about 10.0 will be just right.Special ThanksWe are using the following libraries.shunsukeaihara/colorcorrect