Bitmap/Read a PPM file: Difference between revisions

→‎{{header|PureBasic}}: Added task completion
(Added PicoLisp)
(→‎{{header|PureBasic}}: Added task completion)
Line 835:
EndSelect
StopDrawing()
; Return 1 if successfully loaded to behave as other PurebasicPureBasic functions
ProcedureReturn 1
EndIf
EndIf
EndProcedure</lang>
 
To complete the task, the following code should be added to the above fragment and to the PureBasic solutions for [[Grayscale_image#PureBasic|Grayscale image]] and [[Bitmap/Write_a_PPM_file#PureBasic|Write a PPM file]]
<lang PureBasic>Define file, file2.s, image = 3
file = OpenFileRequester("Select source image file", "*.ppm", "PPM image (*.ppm)|PPM", 0)
If file And LCase(GetExtensionPart(file)) = ".ppm"
LoadImagePPM(image, file)
ImageGrayout(image)
file2 = Left(file, Len(file) - Len(GetExtensionPart(file))) + "_grayscale." + GetExtensionPart(file)
SaveImageAsPPM(image, file2, 1)
EndIf</lang>
 
=={{header|Python}}==
Anonymous user