With the recent extension of camera applications, image filtering is essential in image processing. Weighted median filtering is one of the image denoising method. The weighted median filter can be more useful for removing noise and blurring correction; however, its computational cost is high. Halide is a domain-specific language for image processing. By using Halide, we can easily optimize the code of image processing. In this study, we present weighted median filter with Halide code. Experimental results show that we can easily write the weighted median filter code.