Delete Image using frappe

How do I delete an Image (Attach Image Data Type), on click of custom button?, which will be work same as default “Remove” option given with image.

Which frappe method is used for this?

For that, you have to add a custom script for adding button and then write the action on the button click.
refer the code.

frappe.ui.form.on(“<Doctype name>”, {
refresh: function(cur_frm) {
cur_frm.add_custom_button((‘Remove Image’), function() {
    // set the image field null here