ishiharaStylePlate[img_Image,opts:OptionsPattern[]]:=Module[{size,dotCount,radiusRange,threshold,shapeDilation,foregroundPalette,backgroundPalette,seed,mask,maskData,width,height,points,pixelPositions,maskValues,radii,colors,graphic},size=OptionValue["ImageSize"];dotCount=OptionValue["DotCount"];radiusRange=OptionValue["DotRadiusRange"];threshold=OptionValue["Threshold"];shapeDilation=OptionValue["ShapeDilation"];foregroundPalette=OptionValue["ForegroundPalette"];backgroundPalette=OptionValue["BackgroundPalette"];seed=OptionValue["RandomSeed"];mask=buildIshiharaMask[img,size,threshold,shapeDilation];maskData=ImageData[mask,"Bit"];{width,height}=ImageDimensions[mask];BlockRandom[SeedRandom[seed];points=RandomPoint[Disk[{width/2,height/2},0.48Min[{width,height}]],dotCount];pixelPositions=({Clip[height-Round[#〚2〛]+1,{1,height}],Clip[Round[#〚1〛],{1,width}]}&)/@points;maskValues=Extract[maskData,pixelPositions];radii=RandomReal[radiusRange,dotCount];colors=(If[#1,RandomChoice[foregroundPalette],RandomChoice[backgroundPalette]]&)/@maskValues;graphic=Graphics[MapThread[{#3,Disk[#1,#2]}&,{points,radii,colors}],PlotRange{{0,width},{0,height}},BackgroundWhite,ImageSizesize];Rasterize[graphic,"Image",RasterSize{size,size}]]]